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)

X-Fan 01-30-2002 02:25 PM

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?

fresh_froot 01-30-2002 02:51 PM

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.

X-Fan 01-30-2002 03:17 PM

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.

Justice 02-04-2002 06:44 AM

has anyone tested this on 2.0.3?

KuraFire 02-04-2002 08:35 AM

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:

Justice 02-05-2002 01:43 AM

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??

Justice 02-05-2002 02:23 AM

n/m... read the 3rd reply

Justice 02-05-2002 04:26 AM

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?

Nemesis77 02-09-2002 05:07 AM

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

cavola 02-20-2002 07:10 PM

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

Serge 02-23-2002 10:38 PM

First think I would like to say is your hack is awesome I absoultly love it. But as I was installing it I found that many people and me could not find the lines your were referring to in the install file but as I got to look I think the things might be switched around so the stuff you said needed to go into the Newthread.php should go into newreply.php and visa versa. If I'm wrong please let me know but I will try it that way and see if it works and let everyone know. :)

MarkB 03-17-2002 08:54 PM

I think they may have changed the code between versions... but it seems people are working it out ok :)

X-Fan 03-17-2002 10:49 PM

I used the hack to upgrade from v2.2.2 to v2.2.4 and now this hack has stopped working altogether!

Has anyone got any ideas about re-enabling this hack under v2.2.4?

ZiRu$ 03-27-2002 05:37 PM

when i put in the NP info it dosent show up I think its a problem with where it is in my postbit

i put it here:

PHP Code:

<tr
<
td width="85%"
<
smallfont>$post[icon] <b>$post[title] </b></smallfont>
</
td
<
td width="15%" align="right"
<
smallfont
(<
a href="showthread.php?postid=$post[postid]#post$post[postid]">Post #$countposts</a>)</smallfont></td> 
</tr
</
table
$post[nowplaying
                <
smallfont><a href="showthread.php?threadid=$post[threadid]#post$post[postid]"></a></smallfont>
    <
p><normalfont>$post[message] </normalfont></p>
    
$post[attachment]
                
$post[nowplaying]
    <
p>$post[signature]</p>
    <
p>$post[editedby]<br>$post[editedreason]</p>
    <
p align="right"><smallfont><a href="report.php?s=$session[sessionhash]&postid=$post[postid]">Report this post to a moderator</a> | $post[iplogged]</smallfont></p>
    </
td>
</
tr

if you notice i have it put down twice that's letting you know I tried it in both those places

ZiRu$ 03-27-2002 11:55 PM

^

Serge 03-28-2002 12:06 AM

well first off I would like to know why you have the varable listed twice on your postbit and I also would like to know what verison of vB you are using since people are having problems it seems cause I found some thing to be backwards.

ZiRu$ 03-28-2002 05:56 PM

[QUOTE]Originally posted by Serge
well first off I would like to know why you have the varable listed twice on your postbit and I also would like to know what verison of vB you are using since people are having problems it seems cause I found some thing to be backwards.

ZiRu$ 03-29-2002 03:47 AM

Nevermind man i got it working perfectlly!

Great Hack!

TGO 04-02-2002 09:25 PM

I can't get this to work on 2.2.5..the file changes I'm supposed to make, the "to be replaced" lines are different..and when I try to just add in the NP part I get MySQL errors when trying to post..

Can anyone update the instructions for 2.2.5?

Serge 04-03-2002 10:14 PM

Ok I have found this out. When adding the stuff in try adding the stuff needed in newreply in newthread and newthread in newreply. I looked it over and saw that they were switch and when I installed it that way it worked. :)

Neo 04-03-2002 11:22 PM

This works perfectly for me. since I know php/mysql and it was put together well :p

TGO 04-04-2002 10:46 PM

Care to put up a readme of the changes please? This hack would go down great at my music-mad forum.

Velocd 04-21-2002 05:06 PM

Yea, I'm using 2.2.4 and can't seem to find many of the lines in Newthread.php and Newreply.php, I'm not sure if its because of another hack installed over or just the updated version.

For example, in both Newthread and Newreply this line of code cannot be found:

<smallfont><a href="javascript:checklength(document.vbform);">[check message length]</a></smallfont>

Any help?

Unknown553 04-21-2002 06:43 PM

You look for that line of code in the newreply and newthread TEMPLATES, not the .php files.

Roxie 05-20-2002 09:27 PM

hmmm. everything works except it won't show after the new thread is submitted. Any ideas? I am using 2.2.5

MarkB 06-06-2002 11:27 AM

Did you follow step 7?

Quote:

## Step 7: Edit the template called 'postbit'

Add

$post[nowplaying]

where you want the NP information to appear.

Chris M 06-24-2002 07:07 PM

When is the Update for 2.2.6?

I have done all the instructions, yet it refuses to work...

Satan

Roxie 06-24-2002 07:24 PM

yes, I followed all steps. It's in the postbit, just displaying...

Roxie 06-24-2002 07:25 PM

oops...I meant just NOT displaying

Chris M 06-24-2002 07:43 PM

Yeh...

Ive got a little CD Image, and I even did the editpost.php options...

It still wont show...

Satan

Chris M 06-25-2002 09:58 AM

Anyone?

Satan

disillusioned 08-06-2002 10:23 AM

Awesome hack-
But my forum members are all strong users of the Quick Reply box... and would like the NP functionality to be included there, as well..
I copied the basic
PHP Code:

<p>
<
smallfont><b>Now Playing</b>: What are you listening to? [optional]
<
br><input type="text" class="bginput" name="nowplaying" value="$nowplayingsize="40" maxlength="85" tabindex="1"></smallfont

code to allow them to input the song, but the title doesn't display.

Any ideas?

Chris M 08-06-2002 12:37 PM

What title?

It doesnt work on 2.2.6...

Satan

disillusioned 08-07-2002 09:31 PM

The hack is working fine, and I'm running 2.2.6.
I'm just wondering why, when the form and the code above is included in the quick reply box, does it not add that to the post data. Anyone?
I know this hack won't get much use unless I can put a field for now playing... Suggestions?

Unknown553 08-07-2002 11:49 PM

Is this what you're looking for??

disillusioned 08-07-2002 11:52 PM

Absolutely it- I had the form input on the quick reply template, but do I need to make any changes? The NP wasn't showing up in the post that was made from the quick reply box...

Thanks!

Unknown553 08-08-2002 12:01 AM

Here's what I have as my showthread_quickreply template (yours might be "replybox"):

Code:

<script language="Javascript" src="vbcode.js"></script>
<form enctype="multipart/form-data" action="newreply.php" name="vbform" method="post">
<input type="hidden" name="s" value="">
<input type="hidden" name="action" value="postreply">
<input type="hidden" name="threadid" value="$threadid">
<input type="hidden" name="title" value="">
<input type="hidden" name="iconid" value="0">
<input type="hidden" name="parseurl" value="yes">
<input type="hidden" name="email" value="">
<input type="hidden" name="disablesmilies" value="">
<input type="hidden" name="signature" value="yes">
<input type="hidden" name="rating" value="">

<table cellpadding="{tableouterborderwidth}" cellspacing="0" border="0" bgcolor="{tablebordercolor}" {tableouterextra} width="{contenttablewidth}" align="center"><tr><td>
<table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextra} width="100%">
<tr>
        <td bgcolor="{categorybackcolor}" colspan="2"><normalfont color="{categoryfontcolor}"><b>Quick Reply</b></normalfont></td>
</tr>
<tr>
        <td bgcolor="{firstaltcolor}" valign="top" nowrap><normalfont><b>Your Reply:</b></normalfont><br>
        <smallfont>[<a href="javascript:opensmiliewindow(350,450,'')">Smilies</a>]</smallfont></td>
        <td bgcolor="{firstaltcolor}">
                <table cellpadding="0" cellspacing="0" border="0">
                <tr valign="top">
                        <td><textarea name="message" rows="7" cols="$textareacols" wrap="virtual" tabindex="1"></textarea>
                        </td>
                </tr>
                </table>
        </td>
</tr>
<tr>
<td bgcolor="{secondaltcolor}" valign="top"><normalfont><b>Now Playing:</b></normalfont></td>
<td bgcolor="{secondaltcolor}" valign="top"><smallfont>
<input type="text" class="bginput" name="nowplaying" size="40" maxlength="85" tabindex="2"> (Optional)<br>
What are you listening to?</smallfont></td>
</tr>

</table>
</td></tr></table>

<br>

<table cellpadding="2" cellspacing="0" border="0" width="100%"  align="center">
<tr>
        <td align="center"><normalfont>
        <input type="submit" class="bginput" name="submit" value="Submit Reply" accesskey="s" tabindex="3">

        </normalfont></td>
</tr>
</table>

</form>

In red is the NP part. Hope that helps :)

disillusioned 08-08-2002 01:19 AM

Thanks- I used that exact code even before, and the form appears, and you can enter in the name of the song- but it won't display when entered in through the quick reply method...
It will work through the normal editpost, or new thread or reply to post... or anything but quick reply...

Please help!

Unknown553 08-08-2002 05:05 AM

Make sure you have this at the top:

<form enctype="multipart/form-data" action="newreply.php" name="vbform" method="post">

and that you have name="nowplaying" in the input tag for the now playing box. If that doesnt fix it contact me privately and I'll try to help you from there.

Mike Gaidin 08-11-2002 04:52 PM

Installed on 2.2.6 and it works great. I did leave off the editpost stuff though.


All times are GMT. The time now is 02:44 AM.

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.01429 seconds
  • Memory Usage 1,876KB
  • 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
  • (1)bbcode_code_printable
  • (8)bbcode_php_printable
  • (4)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