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)
-   -   Improved PM Popup JavaScript (https://vborg.vbsupport.ru/showthread.php?t=34356)

TWTCommish 01-23-2002 11:35 PM

Can you post that block of code you have (the code around it, too) in global.php? If you don't want to, that's okay...just wanna help. :) You're right, it is a simple hack, by most hack standards.

TWTCommish 01-23-2002 11:39 PM

Quote:

Originally posted by squawell
i'm sure i have created those templates~~
Any progress? I'd be glad to help if I can. Are you sure you've tried it with any new PMs? Sometimes the vBulletin PM popups don't popup, for no apparent reason. You might want to try it more than once.

Lionel 01-23-2002 11:40 PM

$newpmmsg=0;
$headnewpm='';
if ($checknewpm and $bbuserinfo['userid']!=0 and $bbuserinfo['pmpopup']==2) {
if ($noshutdownfunc) {
$DB_site->query("UPDATE user SET pmpopup=1 WHERE userid=$bbuserinfo[userid]");
} else {
$shutdownqueries[]="UPDATE LOW_PRIORITY user SET pmpopup=1 WHERE userid=$bbuserinfo[userid]";
}
$newpmmsg=1;

$latest_pm = $DB_site->query("SELECT p.privatemessageid AS pm_popup_id, p.title AS pm_popup_title, u.username AS pm_popup_username FROM privatemessage p, user u WHERE messageread = 0 AND touserid = $bbuserinfo[userid] AND p.fromuserid = u.userid ORDER BY dateline DESC");
$hack_pm_total = $DB_site->num_rows($latest_pm);

if ($hack_pm_total > 1) {
eval("\$pm_popup_text = \"".gettemplate('pm_popup_multiple')."\";");
eval("\$pm_popup_url = \"".gettemplate('pm_popup_url_multiple')."\";") ;
} else {
extract($DB_site->fetch_array($latest_pm));
eval("\$pm_popup_text = \"".gettemplate('pm_popup')."\";");
eval("\$pm_popup_url = \"".gettemplate('pm_popup_url')."\";");
}

eval("\$headnewpm = \"".gettemplate('head_newpm')."\";");
}

TWTCommish 01-23-2002 11:43 PM

You should use the code tags next time -- the lack of formatting really hurts the legibility. :)

Anyway, the code looks good. Are you positive the templates are right? Do you get any JS errors? What I did to debug this the first time around was, if it didn't show up, I'd check the HTML on the page to see if the JS was actually there or not. If it's not, that means it hasn't detected a new PM at all. You might need to try it more than once to make sure it's not just a fluke, as it is now and then with vB's JS popup, it seems.

Lionel 01-23-2002 11:46 PM

no errors. It pops up normal like before. But does not tell me the details

TWTCommish 01-23-2002 11:51 PM

Oh! I'm so very, very stupid. I forget the template change. Go back to the first post...I'll edit it as soon as I post this to include the last change needed.

Lionel 01-23-2002 11:57 PM

I put the new part in head_pm. Should I remove old? cause I just got one with no details.

TWTCommish 01-23-2002 11:59 PM

Yes, you're replacing your entire head_newpm template. That should do the trick.

Lionel 01-24-2002 12:03 AM

ok, I just did and awaiting for nex pm... i'll let you know... thanks..

TWTCommish 01-24-2002 12:06 AM

Well, if you want to know sooner, you can just send one to yourself. :) How do you think I tested it? I sure as heck didn't wait for someone to send me one each time. :D Anyway, I hope you like it.


All times are GMT. The time now is 06:17 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.01227 seconds
  • Memory Usage 1,734KB
  • 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_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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