Version: , by MarkB
Developer Last Online: Nov 2009
Version: 2.2.x
Rating:
Released: 11-21-2001
Last Update: Never
Installs: 71
No support by the author.
NOW PLAYING HACK for vBulletin 2.2.8 (UPDATE)
Adds a 'Now Playing' field to your new thread and new reply pages where users can enter whatever they're listening to, and their post will be appended with something akin to: "NP: Some Song by Some Band".
All support questions should be posted in this thread
Remember: BACKUP YOUR DATABASE!! I am not a PHP guru by any stretch of the imagination -- the following code works fine for me, so you should not have any problems.
It's been tested on cB 2.2.8. I will not be held responsible if your forum crashes, or turns into a Britney Spears BB
You can see it in action at my Ultimate Metal forums where I've modified it slightly to have a small CD icon in place of the usual 'NP:'.
This is my first ever hack, so please do let me know any shortcomings or errors!!
I hope you enjoy it as much I plan to
Added to: now includes 'editpost.php' and 'editpost' template changes!
UPDATED for 2.2.8 (very minor fix in newreply.php - if it's working for you, there is NO NEED to upgrade! This will be the last update until vB3 is out
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
I've installed this into 2.2.1 (using the slight mod from a few posts up), and I get the Now Playing box option for new posts and post edits, but the NP text doesn't show up on the post proper.
I placed it between $post[signature] and $post[editedby] in the postbit template yet it's not showing up there.
Originally posted by fresh_froot Just play around with it. You'll ge the jist of things, and probably figure it out. I managed to work it out in the end.
I've been playing around with it - trying to put $post[nowplaying] in different locations but so far no luck.
One thing I did notice with the install instructions is that for step 4, editing newreply.php, it said to find:
PHP Code:
$DB_site->query("UPDATE post SET pagetext='".addslashes($message)."',allowsmilie='$allowsmilie',showsignature='$signature',iconid='$iconid',attachmentid='$attachmentid' WHERE postid='$posts[minpost]'");
But I couldn't find that in my newreply.php (perhaps because I'm using vbPortal?). The closest I found was:
PHP Code:
$DB_site->query("UPDATE post SET title='".addslashes(htmlspecialchars($title))."',pagetext='".addslashes($message)."',allowsmilie='$allowsmilie',showsignature='$signature',iconid='$iconid',attachmentid='$attachmentid' WHERE postid='$postid'");
So I edited that to be:
PHP Code:
$DB_site->query("UPDATE post SET title='".addslashes(htmlspecialchars($title))."',pagetext='".addslashes($message)."',NP='".addslashes($nowplaying)."',allowsmilie='$allowsmilie',showsignature='$signature',iconid='$iconid',attachmentid='$attachmentid' WHERE postid='$postid'");
Also, still in newreply.php, it said to find this:
PHP Code:
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($subject))."','".addslashes($postusername)."','$bbuserinfo[userid]','".time()."','$attachmentid','".addslashes($message)."','$allowsmilie','$signature','$ipaddress','$iconid','1')");
But the closest I could find was this:
PHP Code:
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($title))."','".addslashes(htmlspecialchars($postusername))."','$bbuserinfo[userid]','".time()."','$attachmentid','".addslashes($message)."','$allowsmilie','$signature','$ipaddress','$iconid','$visible')");
So I changed that to:
PHP Code:
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,NP,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($title))."','".addslashes(htmlspecialchars($postusername))."','$bbuserinfo[userid]','".time()."','$attachmentid','".addslashes($message)."','".addslashes($nowplaying)."','$allowsmilie','$signature','$ipaddress','$iconid','$visible')");
Everything is working fine except that the Now Playing doesn't show up where indicated in the postbit template.
MarkB, just wanted you to know that everyone on my board is, like, REALLY excited about this hack, and they're using it plentifully! On all forums, even, so that whole thing we discussed earlier in this thread (only appear on one forum) is Totally not needed after all.
ok, I installed it... works beautifully. one problem though... there's no filter for censored words or html... users could really take advantage of this and add harmful tags to mess up pages.
is there a quick and dirty way to disable html in the "postbit_nowplaying" template?
The only similiar UPDATE POST code is on line 202 of newthread.php:
PHP:--------------------------------------------------------------------------------
$DB_site->query("UPDATE post SET pagetext='".addslashes($message)."',allowsmilie='$ allowsmilie',showsignature='$signature',iconid='$i conid',attachmentid='$attachmentid' WHERE postid='$posts[minpost]'");
PHP:--------------------------------------------------------------------------------
$DB_site->query("UPDATE post SET pagetext='".addslashes($message)."',NP='".addslash es($nowplaying)."',allowsmilie='$allowsmilie',show signature='$signature',iconid='$iconid',attachment id='$attachmentid' WHERE postid='$posts[minpost]'");
I did this and now when people enter a song name in the now playing field, and they submit thier post. it put ths name of the song as thier post and the post as the name of the song.
It works fine for replying to a post but not for making a new thread.
anyone know what's going on. Runnings this on vb 2.2.1