CuteFields MySQL

Download plugins, language packs and stuff.

CuteFields MySQL

Postby Dr.Twister » Thu Apr 26, 2007 12:45 pm

New Version - With Lots of Options

What is CuteFields?

CuteFields allows you to create custom MySQL fields for your news posts and then be able to call the custom fields through embed variables inside of your templates.

Installing CuteFields

1. Unzip cutefields2.zip
2. Copy cutefields.php to the CuteNews/Plugins directory.
3. Copy mysql.class.php to the CuteNews/inc/db directory.
4. Activate the plugin from the CuteNews admin menu using the Manage Plugins link.
5. Select Activate CuteFields
6. Select the CuteFields options from the admin menu.
7. Create the CuteFields Tables using the button that appears in the top of the options menu.
8. Begin adding custom fields.

Creating CuteFields

1. Within the CuteFields options menu, select from the drop down menu ADD and click the GO button.
2. Enter the name of the new field. This is the name that will appear in your embed variable {cf:name}
3. Enter a description of the field for your reference.
4. Select a field type. You can now choose five options: Text Box, Text Area, Drop Down, Checkboxes and Radio Buttons.
5. Enter the size of the field. The field size represents how many options you would like for your field type.

For example:

A field size of 2 under radio buttons could be used for Male or Female.

A field size of 4 under checkboxes could be used for Dog, Cat, Bird, Fish.

Using CuteFields

Inside your templates you should now see options for your new custom fields. They will appear in the format of {cf:fieldname}. So for example if your custom field name is color the template variable will be {cf:color}. In your template it might look like this:

<td bgcolor="{cf:color}">I like the color {cf:color}</td>

Conditional display is also now available. Using the format like this:

[ifcf:color]I like the color {cf:color}[/ifcf:color].

What CuteFields does NOT do and what I'm working on to add:

1. There is currently no SORTING capabilities YET
2. There is not an option for a 'default' value for your fields.
3. There is no association with categories.
4. This does not work on TextSQL, ONLY MYSQL using CuteNews.ru PHP/MySQL
5. There is no search capabilities YET

Any questions, contact me at drtwister@drtwister.net

This is a first release, so bear with me if you find bugs, issues or have questions. Enjoy.

Update: version 2.1 - Text area now supports full HTML
Update: version 2.1 - Re-uploaded confirmed working version.
Attachments
cutefields2.1.zip
CuteFields - MySQL Custom Input Fields (v.2.1)
(12.14 KiB) Downloaded 1005 times
Last edited by Dr.Twister on Tue Oct 16, 2007 2:51 pm, edited 9 times in total.
Dr.Twister
 
Posts: 55
Joined: Mon Apr 23, 2007 4:57 am

Postby x-byte » Thu Apr 26, 2007 2:10 pm

Good work. Finally SQL support for Xfields :)



I can't test it though, but I look forward for a version which support multiple lines etc.
x-byte
 
Posts: 170
Joined: Mon Nov 14, 2005 6:31 am

Postby Saszoo » Thu Apr 26, 2007 3:30 pm

Very good work indeed :)
User avatar
Saszoo
 
Posts: 414
Joined: Wed Jun 07, 2006 10:34 pm
Location: Norway

Postby PJR » Thu Apr 26, 2007 6:24 pm

Very good! I've got one wish - I would like to have some kind of radio button to "activate" other plugins... ;)
PJR
 
Posts: 165
Joined: Mon Oct 17, 2005 3:15 pm
Location: Czech republic

Postby scottdallas » Fri Apr 27, 2007 6:55 am

Holy crap! Nice hack. You're 6th post and it's a freakin cutenews hack! I'm in my 700's and I'm still a n00b lol. No fair! I can't wait to try it :) Downloading now
Everyday I'm tumblin http://scodal.tumblr.com
User avatar
scottdallas
 
Posts: 2244
Joined: Thu May 04, 2006 6:46 pm
Location: US

Postby Dr.Twister » Fri Apr 27, 2007 6:59 pm

Well don't forget, my other account had over 20 posts. When I first registered I only used "Twist" but most people know me by my full handle, so I figured I'd re-register with that.



Either way, let me know what you think.



dt
Dr.Twister
 
Posts: 55
Joined: Mon Apr 23, 2007 4:57 am

Postby scottdallas » Sun Apr 29, 2007 8:39 am

When I activate it and save news it gives me a MySQL error at the very top of the admin panel.. let me try to recreate it so you can see. I have it deactivated for now.. I didn't need it for the project I tested it.. I just wanted to see it in action. This plugin is amazing! After I saw how it's going to work I realize this makes cutenews.ru EXTREMELY powerful. It's like XFields with caffeine.



Okay, so this is what I see after I add a story at the top of cnr:



Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/content/s/c/o/scodal/html/tastypolls/admin/inc/db/mysql.class.php on line 248



Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/content/s/c/o/scodal/html/tastypolls/admin/inc/db/mysql.class.php on line 248




Could it be perhaps because I added this plugin AFTER installation since it uses MySQL? Does it need to be installed at the same time you install cnr? PHP4 or PHP5 problems? Did I code it into cnr wrong? Anyone else having this error?
Everyday I'm tumblin http://scodal.tumblr.com
User avatar
scottdallas
 
Posts: 2244
Joined: Thu May 04, 2006 6:46 pm
Location: US

Postby Dr.Twister » Sun Apr 29, 2007 2:18 pm

What version of MySQL are you using?



It shouldn't be dependent on either the version of PHP or MySQL. It also shouldn't matter when or how you installed it.



Did you create the CuteField tables? The only time the mysql_num_rows is called is to read the CuteFields tables. So if they aren't there yet, you might get that error.
Dr.Twister
 
Posts: 55
Joined: Mon Apr 23, 2007 4:57 am

Postby scottdallas » Sun Apr 29, 2007 2:51 pm

mysql 4.1 but.. wow.. im an idiot. no i didn't push the button. error is gone haha.. shows you how well i follow instructions! wow! with this addition to cutenews.ru i think i can truly make it do almost anything. thanks so much man!
Everyday I'm tumblin http://scodal.tumblr.com
User avatar
scottdallas
 
Posts: 2244
Joined: Thu May 04, 2006 6:46 pm
Location: US

Postby Dr.Twister » Sun Apr 29, 2007 3:27 pm

I have run into a few issues which I didn't prepare for. If you are simply adding the new stuff as you go, it's not an issue. But I was hoping to use this for a full data dump and be able to add news quickly. The problem is I can get my data into the CuteFields, but then I have to match them up manually with the actual news post.



I'll have to figure out if I should address that, or just forget about it, considering most people won't use it for that.



Now if I can add sorting and conditional displays and multiline/radio button/drop down support.... We'll be really cruising.
Dr.Twister
 
Posts: 55
Joined: Mon Apr 23, 2007 4:57 am

Postby scottdallas » Sun Apr 29, 2007 5:18 pm

And checkbox just in case!
Everyday I'm tumblin http://scodal.tumblr.com
User avatar
scottdallas
 
Posts: 2244
Joined: Thu May 04, 2006 6:46 pm
Location: US

Postby Dr.Twister » Mon Apr 30, 2007 1:43 am

So here's a question for everyone. If there was a way to do checkboxes or drop downs or radio buttons, the values of the options would also have to be stored in the database. This is not a major issue except when you can't predict how many options there will be. For instance I could say the new Field COLOR is a selection of Radio Button options. When creating this field you specify you want 5 radio buttons. Red, Blue, Green, Yellow, Orange. Easy... the database would list each option out and store it.



My concern is that someone may decide they want 50 options in a drop down menu. Not too far fetched. Say you want a drop down menu that list each of the 50 United States. It's one thing to have this hard coded, it's another when building a database to support these options. Again not difficult, just a lot of extra database space.



I suppose ultimately it's up to the user. If they really want to create 50 options in their database, then go for it.



Bu you tell me... what might you use it for? How many options do you think you would make available on a normal basis?



-dt
Dr.Twister
 
Posts: 55
Joined: Mon Apr 23, 2007 4:57 am

Postby scottdallas » Mon Apr 30, 2007 12:37 pm

Hmm.. hard for me to say. Most the time I'd probably only use 1-3 but you're right maybe sometimes I'd go crazy and have 50.
Everyday I'm tumblin http://scodal.tumblr.com
User avatar
scottdallas
 
Posts: 2244
Joined: Thu May 04, 2006 6:46 pm
Location: US

Postby PJR » Mon Apr 30, 2007 4:13 pm

The more, the better = more gives universality ;)
PJR
 
Posts: 165
Joined: Mon Oct 17, 2005 3:15 pm
Location: Czech republic

Postby Saszoo » Mon Apr 30, 2007 4:40 pm

I seldom use more than 15, but of course, as PJR said...
User avatar
Saszoo
 
Posts: 414
Joined: Wed Jun 07, 2006 10:34 pm
Location: Norway

Next

Return to Additional Downloads



Who is online

Users browsing this forum: No registered users and 2 guests

cron

x