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=58489)

latinO 11-19-2003 11:32 AM

When I add a music title like artist - Don't let go, I get an MSQL database error because of the '

How can I fix this?

Thanks!

Dan 11-20-2003 04:23 AM

Quote:

Originally Posted by latinO
When I add a music title like artist - Don't let go, I get an MSQL database error because of the '

How can I fix this?

Thanks!

Hmm..... you shouldn't get an error.... I'll look into this and check it out.

Brad 12-09-2003 08:25 AM

Quote:

Originally Posted by Dan
Hmm..... you shouldn't get an error.... I'll look into this and check it out.

Hi Dan, I downloaded this today and noticed a few things in it you missed. This will fix the error with the ' throwing errors:

in newthread.php find:

PHP Code:

$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible,nowp) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($title))."','".addslashes($postusername)."','$bbuserinfo[userid]','".time()."','$attachmentid','".addslashes($message)."','$allowsmilie','$signature','$ipaddress','$iconid','$visible', '$nowp')"); 

Replace it with:

PHP Code:

$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible,nowp) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($title))."','".addslashes($postusername)."','$bbuserinfo[userid]','".time()."','$attachmentid','".addslashes($message)."','$allowsmilie','$signature','$ipaddress','$iconid','$visible', '".addslashes(htmlspecialchars($nowp))."')"); 

In newreply.php find:

PHP Code:

$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible,nowp) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($title))."','".addslashes($postusername)."','$bbuserinfo[userid]','".time()."','$attachmentid','".addslashes($message)."','$allowsmilie','$signature','$ipaddress','$iconid','$visible', '$nowp')"); 

Replace with:

PHP Code:

$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible,nowp) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($title))."','".addslashes($postusername)."','$bbuserinfo[userid]','".time()."','$attachmentid','".addslashes($message)."','$allowsmilie','$signature','$ipaddress','$iconid','$visible', '".addslashes(htmlspecialchars($nowp))."')"); 

And this will hide 'now playing' in the postbit when it is not in use:

in functions.php find:

PHP Code:

        if ($post[homepage]!="" and $post[homepage]!="http://") {
            eval(
"\$post[homepage] = \"".gettemplate("postbit_homepage")."\";");
        } else {
            
$post[homepage]="";
        } 

Under It add:

PHP Code:

        if ($post['NOWP'] != '')
        {
            eval(
"\$nowplayi_ng = \"".gettemplate("postbit_nowplaying")."\";");
        }
        else
        {
            
$nowplayi_ng '';
        } 

Make a new template call postbit_nowplaying and populate it with:

PHP Code:

Now Playing$post[NOWP

Open the postbit template find:

PHP Code:

Now Playing$post[NOWP

Replace with:

PHP Code:

$nowplayi_ng 

Last but not least in showthread.php do the fallowing to avoid un-cached templates throwing extra querys:

Find:

PHP Code:

,postbit_buddy,postbit_useremail 

Replace with:

PHP Code:

,postbit_buddy,postbit_useremail,postbit_nowplaying

Find:

PHP Code:

,postbit_search,postbit_buddy

Replace with:

PHP Code:

,postbit_search,postbit_buddy,postbit_nowplaying


All done, keep up the good work Dan :)


All times are GMT. The time now is 02:11 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.01396 seconds
  • Memory Usage 1,760KB
  • 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
  • (13)bbcode_php_printable
  • (2)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
  • (3)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