View previous topic :: View next topic |
Author |
Message |
Mystis
Joined: 02 Mar 2003 Posts: 74
|
Posted: Mon Jun 09, 2003 7:54 am Post subject: b2customfields 2: Better custom post field functionality |
|
|
Or how about 'b2customfieldserer'? Or maybe even 2 b2customfields 2 furious'?That's right, it's back! Back and better than ever. At least better than 2 fast 2 furious, trust me on that one. I believe I located the problem that seems to have caused about half the people who attempted to install it to get mysql errors, and I fixed it. I also wrote in some extra functionality that I'm sure you all will appreciate. Now, not only can you make a custom field that's an input box, but you can also make a textarea, select box, or checkbox! Let me know if you have any problems installing or anything, but this time should go over smoother than last time. Thanks!
Download here
Upgrade instructions here _________________ - Mystis
[url=tidakada.com/board/viewtopic.php?t=3375]b2customfields v2[/url] | [url=tidakada.com/board/viewtopic.php?t=3375]b2sql[/url] | [url=tidakada.com/board/viewtopic.php?t=3375]b2quotes[/url]
Last edited by Mystis on Mon Jun 09, 2003 7:27 pm; edited 2 times in total |
|
Back to top |
|
 |
bigsimon
Joined: 04 Jan 2003 Posts: 13
|
Posted: Mon Jun 09, 2003 9:03 am Post subject: |
|
|
Any chance you'll post instructions for an upgrade from an older version? I've been using it for quite some time now, but haven't a clue what I'd have to replace to get the new functionality. _________________ bigSimon |
|
Back to top |
|
 |
Mystis
Joined: 02 Mar 2003 Posts: 74
|
Posted: Mon Jun 09, 2003 2:45 pm Post subject: |
|
|
Your best bet for an upgrade is to completely uninstall the original b2customfields (just reverse all the steps of the original installation - instructions here - omit altering the database however), then run the following SQL query in place of Step 1:
Code: |
ALTER TABLE `b2customfields` ADD `field_options` TEXT NOT NULL;
ALTER TABLE `b2customfields` ADD `field_type` TEXT NOT NULL;
|
Then, continue on with the installation process as normal. I wrote some very sloppy code in the first release, so it would be relatively painful to try and write proper upgrade instructions. That's one of the reasons that using this more recent version is relatively critical. _________________ - Mystis
[url=tidakada.com/board/viewtopic.php?t=3375]b2customfields v2[/url] | [url=tidakada.com/board/viewtopic.php?t=3375]b2sql[/url] | [url=tidakada.com/board/viewtopic.php?t=3375]b2quotes[/url] |
|
Back to top |
|
 |
xytx
Joined: 24 May 2003 Posts: 48
|
Posted: Tue Jun 10, 2003 4:15 pm Post subject: |
|
|
i installed the tables successfully, but they don't show up am i forgetting something? i also need a little understanding on how to add a function at the end do i use another <? ?> or i put it above the ?> |
|
Back to top |
|
 |
Mystis
Joined: 02 Mar 2003 Posts: 74
|
Posted: Wed Jun 11, 2003 4:45 am Post subject: |
|
|
add the functions directly before the ?>, outside of any brackets. I'm not quite sure I understand you though with the database tables. What do you mean that they don't 'show up'? _________________ - Mystis
[url=tidakada.com/board/viewtopic.php?t=3375]b2customfields v2[/url] | [url=tidakada.com/board/viewtopic.php?t=3375]b2sql[/url] | [url=tidakada.com/board/viewtopic.php?t=3375]b2quotes[/url] |
|
Back to top |
|
 |
annia
Joined: 09 Apr 2002 Posts: 18
|
Posted: Wed Jun 11, 2003 7:13 am Post subject: |
|
|
How can I edit your hack so that it doesn't show anything in posts with empty additional fields.. all my old posts (before I installed the hack) now got empty
Current mood:
Current site:
entries under them.. :( |
|
Back to top |
|
 |
Mystis
Joined: 02 Mar 2003 Posts: 74
|
Posted: Wed Jun 11, 2003 2:32 pm Post subject: |
|
|
Code: | Mood: <?php getcustomfield('mood'); ?> |
If your template currently looks like that, replace it with this:
Code: | <?
$mood = getcustomfield('mood');
if(!empty($mood)){
echo "Mood: ".$mood;
}
?> |
If your field is not called 'mood', then edit the code accordingly. _________________ - Mystis
[url=tidakada.com/board/viewtopic.php?t=3375]b2customfields v2[/url] | [url=tidakada.com/board/viewtopic.php?t=3375]b2sql[/url] | [url=tidakada.com/board/viewtopic.php?t=3375]b2quotes[/url]
Last edited by Mystis on Sat Jun 14, 2003 1:52 am; edited 1 time in total |
|
Back to top |
|
 |
xytx
Joined: 24 May 2003 Posts: 48
|
Posted: Thu Jun 12, 2003 2:25 am Post subject: |
|
|
i tried installing it and i didnt even get the custom field part on the menu bar like i got b4. i dont have the code right now cause i put my regular files back. but i added the function before the ?> and outside of the last bracket on that function, and it still wouldnt work. i'll try again tho. |
|
Back to top |
|
 |
Mystis
Joined: 02 Mar 2003 Posts: 74
|
Posted: Thu Jun 12, 2003 6:01 pm Post subject: |
|
|
xytx wrote: | i tried installing it and i didnt even get the custom field part on the menu bar like i got b4. i dont have the code right now cause i put my regular files back. but i added the function before the ?> and outside of the last bracket on that function, and it still wouldnt work. i'll try again tho. |
Then you missed the 6th step:
Quote: | __________________________________________________________________________
| |
| Step 6: Open up the file b2-include/b2menutop.txt. Before the '***', |
| add the following line. Adjust the '10' to reflect the minimum level |
| the user needs to access the section in the administrative panel: |
| between 0 and 10. I reccomend leaving it at 10, unless you have a co- |
| administrator. |
|__________________________________________________________________________|
10 b2fields.php Custom Fields |
_________________ - Mystis
[url=tidakada.com/board/viewtopic.php?t=3375]b2customfields v2[/url] | [url=tidakada.com/board/viewtopic.php?t=3375]b2sql[/url] | [url=tidakada.com/board/viewtopic.php?t=3375]b2quotes[/url] |
|
Back to top |
|
 |
blog17
Joined: 28 Jan 2003 Posts: 144 Location: London, UK
|
|
Back to top |
|
 |
joni
Joined: 13 Jun 2003 Posts: 2
|
Posted: Fri Jun 13, 2003 9:50 pm Post subject: |
|
|
i tried installing it, but when i went to the login page, i got this error:
Code: |
Warning: Cannot modify header information - headers already sent by (output started at /home/joni/public_html/b2-include/b2functions.php:1344) in /home/joni/public_html/b2login.php on line 294
Warning: Cannot modify header information - headers already sent by (output started at /home/joni/public_html/b2-include/b2functions.php:1344) in /home/joni/public_html/b2login.php on line 295
Warning: Cannot modify header information - headers already sent by (output started at /home/joni/public_html/b2-include/b2functions.php:1344) in /home/joni/public_html/b2login.php on line 296
Warning: Cannot modify header information - headers already sent by (output started at /home/joni/public_html/b2-include/b2functions.php:1344) in /home/joni/public_html/b2login.php on line 297
Warning: Cannot modify header information - headers already sent by (output started at /home/joni/public_html/b2-include/b2functions.php:1344) in /home/joni/public_html/b2login.php on line 298
|
i'm pretty sure that i followed the steps correctly, so could somebody please tell me what went wrong? |
|
Back to top |
|
 |
Candle
Joined: 23 Dec 2002 Posts: 547
|
|
Back to top |
|
 |
xytx
Joined: 24 May 2003 Posts: 48
|
Posted: Sat Jun 14, 2003 1:44 am Post subject: |
|
|
nevermind i got it, its a great hack mystis! |
|
Back to top |
|
 |
Mystis
Joined: 02 Mar 2003 Posts: 74
|
Posted: Sat Jun 14, 2003 1:49 am Post subject: |
|
|
joni wrote: | i tried installing it, but when i went to the login page, i got this error:
Code: |
Warning: Cannot modify header information - headers already sent by (output started at /home/joni/public_html/b2-include/b2functions.php:1344) in /home/joni/public_html/b2login.php on line 294
Warning: Cannot modify header information - headers already sent by (output started at /home/joni/public_html/b2-include/b2functions.php:1344) in /home/joni/public_html/b2login.php on line 295
Warning: Cannot modify header information - headers already sent by (output started at /home/joni/public_html/b2-include/b2functions.php:1344) in /home/joni/public_html/b2login.php on line 296
Warning: Cannot modify header information - headers already sent by (output started at /home/joni/public_html/b2-include/b2functions.php:1344) in /home/joni/public_html/b2login.php on line 297
Warning: Cannot modify header information - headers already sent by (output started at /home/joni/public_html/b2-include/b2functions.php:1344) in /home/joni/public_html/b2login.php on line 298
|
i'm pretty sure that i followed the steps correctly, so could somebody please tell me what went wrong? |
It appears that you bungled the step where you add functions to b2functions.php. If you want to package up the file and mail them my way ([email protected]) I'll take a look at it for you. _________________ - Mystis
[url=tidakada.com/board/viewtopic.php?t=3375]b2customfields v2[/url] | [url=tidakada.com/board/viewtopic.php?t=3375]b2sql[/url] | [url=tidakada.com/board/viewtopic.php?t=3375]b2quotes[/url] |
|
Back to top |
|
 |
joni
Joined: 13 Jun 2003 Posts: 2
|
Posted: Sat Jun 14, 2003 3:57 am Post subject: |
|
|
nevermind. i finally found out what went wrong. thanks for offering to help, though.  |
|
Back to top |
|
 |
|