Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Details »»

Version: , by MarkB MarkB is offline
Developer Last Online: Nov 2009 Show Printable Version Email this Page

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.

Comments
  #42  
Old 01-30-2002, 02:25 PM
X-Fan's Avatar
X-Fan X-Fan is offline
 
Join Date: Jan 2002
Location: Adelaide, Australia
Posts: 496
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.

Any ideas?
Reply With Quote
  #43  
Old 01-30-2002, 02:51 PM
fresh_froot fresh_froot is offline
 
Join Date: Jan 2002
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #44  
Old 01-30-2002, 03:17 PM
X-Fan's Avatar
X-Fan X-Fan is offline
 
Join Date: Jan 2002
Location: Adelaide, Australia
Posts: 496
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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.
Reply With Quote
  #45  
Old 02-04-2002, 06:44 AM
Justice's Avatar
Justice Justice is offline
 
Join Date: Oct 2001
Location: New Orleans
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

has anyone tested this on 2.0.3?
Reply With Quote
  #46  
Old 02-04-2002, 08:35 AM
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Oct 2001
Location: inside vB3's .php
Posts: 1,245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.

Thanks man, awesome hack! :up:
Reply With Quote
  #47  
Old 02-05-2002, 01:43 AM
Justice's Avatar
Justice Justice is offline
 
Join Date: Oct 2001
Location: New Orleans
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Justice
has anyone tested this on 2.0.3?
i'd really like to install this hack, but I don't want to alter my database if it won't work for 2.0.3... anyone??
Reply With Quote
  #48  
Old 02-05-2002, 02:23 AM
Justice's Avatar
Justice Justice is offline
 
Join Date: Oct 2001
Location: New Orleans
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

n/m... read the 3rd reply
Reply With Quote
  #49  
Old 02-05-2002, 04:26 AM
Justice's Avatar
Justice Justice is offline
 
Join Date: Oct 2001
Location: New Orleans
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #50  
Old 02-09-2002, 05:07 AM
Nemesis77 Nemesis77 is offline
 
Join Date: Nov 2001
Location: canada
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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]'");

--------------------------------------------------------------------------------


change above code to:


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
Reply With Quote
  #51  
Old 02-20-2002, 07:10 PM
cavola cavola is offline
 
Join Date: Feb 2002
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay.. is there another way of adding a new field to post table other than using phpmyadmin?! I am not familiar with this... thanks.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:02 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04877 seconds
  • Memory Usage 2,326KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete