vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   'Now Playing' Hack (https://vborg.vbsupport.ru/showthread.php?t=32587)

MarkB 11-21-2001 10:00 PM

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 :)

squawell 11-22-2001 06:28 AM

this hack sounds good~~

thankz MarkB!!:D

Lesane 11-22-2001 09:54 AM

Sounds Great, i gonna try it on my 2.0.3 version

Lesane 11-22-2001 11:17 AM

It works great, i had 2 change some codes but finally it works fine on vb 2.0.3

Also where it says:
PHP Code:

Add 

$postbit
[nowplaying

where you want the NP information to appear

That didnt worked, i changed it to $post[nowplaying] and it works perfect now.

Thanks for the great hack.

MarkB 11-22-2001 11:41 AM

Quote:

Originally posted by Lesane
Also where it says:
PHP Code:

Add 

$postbit
[nowplaying

where you want the NP information to appear

That didnt worked, i changed it to $post[nowplaying] and it works perfect now.

Thanks for the great hack.

Oops, sorry, that was indeed an error. I've updated the attachment :) Thanks for pointing it out! :)

TheComputerGuy 11-22-2001 12:07 PM

Purty Work, consider it installed

|DarkManX| 11-22-2001 02:14 PM

great hack....

was wondering how i would alter the nowplaying template to have a image instead of saying NP:

thanks for this :)

|DarkManX| 11-22-2001 02:21 PM

coooool, i figured out how to add the image on my own....thanks again!!

Lesane 11-22-2001 02:28 PM

Mark, i also edited the editpost.php & editpost template so that if someone edit his post then he can add the np too.

*hint* ;)

|DarkManX| 11-22-2001 02:32 PM

Quote:

Originally posted by Lesane
Mark, i also edited the editpost.php & editpost template so that if someone edit his post then he can add the np too.

*hint* ;)


good idea :)

MarkB 11-22-2001 08:57 PM

Oh yes, something else I forgot :( :eek:

I will update the installation instructions to include the edit changes :) Thanks Lesane! :)

MarkB 11-22-2001 09:05 PM

Here's a copy of the little CD image I use on my site, if anyone's interested... (and if anyone can make a clearer one, pls let me know:p)

|DarkManX| 11-22-2001 09:10 PM

here it is

Sinecure 11-22-2001 11:14 PM

Ahh, great you released it. As I said before once I have finished updating my board and implementing the new design, I am going to add this one :D

Bane 11-23-2001 01:07 AM

Nice Hack Mark :) Great work!

MarkB 11-23-2001 01:11 AM

Thanks! :) I can't believe it works! LOL

|DarkManX| 11-23-2001 02:03 PM

found this icon too.....


white background though....but you should be able to edit it... :)

|DarkManX| 11-24-2001 04:40 AM

here is another, let me know if ya like any of these....

Goldfinger 11-24-2001 11:57 AM

Installed. Great hack man. Once my board is done for sure this hack will be installed.

MarkB 11-24-2001 12:09 PM

Cool! Glad you like it :D

NP: Vintersorg - The Enigmatic Spirit :)

|DarkManX| 11-24-2001 01:11 PM

what do you all think of this icon??

MarkB 11-24-2001 01:16 PM

LOL! That icon rocks! :)

|DarkManX| 11-24-2001 01:16 PM

Quote:

Originally posted by MarkB
LOL! That icon rocks! :)


:)

i know, thats what i am using right now!!!

Nupraptor 11-24-2001 04:02 PM

Do you think it would be possible to have something which automatically detects what Winamp is currently playing? I realize that it would probably be rather extensive, but I think it'd also be kind of neat.

|DarkManX| 11-24-2001 04:11 PM

Quote:

Originally posted by Nupraptor
Do you think it would be possible to have something which automatically detects what Winamp is currently playing? I realize that it would probably be rather extensive, but I think it'd also be kind of neat.


lol, there is a script like that for IRC...........

if it is possible here.......that would be a serious hack....cuz winamp would have to send the song info to the server the vb was on and then the vb would have to take that info and insert it into one of your posts.........

damn...don't be lazy, just type it in man :rolleyes:

MarkB 11-24-2001 09:52 PM

I'm using a winamp plugin that copies the band/song to my clipboard - but it's an IRC-related plugin, so mIRC needs to be running all the time :(

Still, it's nice and easy tho :)

Airwaves 12-05-2001 11:25 AM

Any chance for a WinXP themed icon to use for this hack?

KuraFire 12-10-2001 11:29 AM

Would it be possible to define this hack so that the "Now Playing: " entry boxes (in new thread / new reply / edit post) only appear in one specific forum?

I have a Music forum on my board, it'd be great to have this hack available only on threads THERE, not elsewhere. If it's not possible or not easily done, I'll just install it and see it appear everywhere - no harm in that, really... But I'd prefer forum-specific...

MarkB 12-10-2001 11:38 AM

I'm sure there would be a way to do this without having an extra template set, but that'd be the easy way for now...

Sorry I can't be of more help :(

KuraFire 12-10-2001 11:54 AM

I checked your install instructions, and I think it won't be easily done with the way you set it up. For it to be forum specific, it'd have to be coded into the newthread.php and newreply.php (or whatever) files, something like

PHP Code:

if forumid=xx
 display
("NP"

(but then in correct PHP coding and all - I'm still a PHP n00b, lol)

But you added the entry fields and all to the templates, not to the pages. This way, I don't know if such PHP coding would work...

We need FireFly or so in here ;)

MarkB 12-10-2001 12:11 PM

Something like that sounds about right - Chen did a hack for me where certain forums have a different first post display - I imagine that this would use something similar...

KuraFire 12-10-2001 03:42 PM

*nods*

I wouldn't know how to do it in PHP or anything, but I'm sure that the only 'scripting' necessary here, is for one single IF statement to check whether this forum is id x (where x is defined in the code by the admin) and IF so, it makes this hack appear, and if NOT, it doesn't...

Maybe we should ask someone with more experience about it.. :)

ReT 01-08-2002 05:44 PM

i cant find this piece of code in 2.2.1

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


Lesane 01-09-2002 09:02 AM

Quote:

Originally posted by ReT
i cant find this piece of code in 2.2.1

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


The only similiar UPDATE POST code is on line 202 of newthread.php:

PHP Code:

$DB_site->query("UPDATE post SET pagetext='".addslashes($message)."',allowsmilie='$allowsmilie',showsignature='$signature',iconid='$iconid',attachmentid='$attachmentid' WHERE postid='$posts[minpost]'"); 

change above code to:

PHP Code:

$DB_site->query("UPDATE post SET pagetext='".addslashes($message)."',NP='".addslashes($nowplaying)."',allowsmilie='$allowsmilie',showsignature='$signature',iconid='$iconid',attachmentid='$attachmentid' WHERE postid='$posts[minpost]'"); 

Your welcome Derek :D

ReT 01-09-2002 04:23 PM

Thanks Maurice :D

DelusionalMind 01-27-2002 07:39 AM

will be installing this in the morning over at teencribs.com

should be a nice addition over there :)

Lionel 01-27-2002 10:59 AM

One can also pull out the data and establish a top10 chart...

Lionel 01-28-2002 05:54 AM

I installed this one very easily. I'd like to know: in edit post, the choice that was entered at first is not being redisplayed and have to be re-entered. Is that the way it is supposed to be or did I miss something?

thanks

fresh_froot 01-29-2002 05:49 PM

How about the option to choose from different icons. Maybe a CD or Music note for music, or a PS2 or Xbox or even PC for Videogames.

This could be a popular addition for any gaming sites as well, where people playing on more than one format.

Love the hack! Maybe it'll be come more.

Another thing...the directions for editing newpost are for newreply and vice versa. I don't know if anyone else caught that.

ytclear 01-29-2002 09:32 PM

i installed the hack and i thought everything was working fine, EXCEPT now when people hit post reply on old threads it puts there reply 2nd from last instead of last post.

Weird as ****


All times are GMT. The time now is 10:29 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.01267 seconds
  • Memory Usage 1,826KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete