Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
PM 'You have X New Message(s)' relocation Details »»
PM 'You have X New Message(s)' relocation
Version: , by imageconstrux imageconstrux is offline
Developer Last Online: Feb 2016 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 02-02-2003 Last Update: Never Installs: 0
 
No support by the author.

I'm wanting to relocate just the text and variable from the forumhome_pmloggedin template (You have $newpm[messages] new message(s) since your last visit) to the header.

I'm relatively new at this, so I just copied

PHP Code:
<b>$bbuserinfo[username]</b> - You have $newpm[messages] new message(ssince your last visit
And pasted it into the header template. Everything showed up of course, except the variable $newpm.

What else do I need to call out in from the forumhome_pmloggedin template to make the # of new messages show up?

Thanks,

Jeff

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 02-02-2003, 02:58 AM
Tony G's Avatar
Tony G Tony G is offline
 
Join Date: Nov 2001
Location: Melbourne, Australia
Posts: 8,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hacking is probably required as that variable is only coded to work in that one template.
Reply With Quote
  #3  
Old 02-02-2003, 03:05 AM
imageconstrux imageconstrux is offline
 
Join Date: Jan 2003
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Would it be possible to have the header call out a new template, and then make that new template just like forumhome_pmloggedin, without any of the formatting?

Would that work?
Reply With Quote
  #4  
Old 02-02-2003, 10:38 AM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No this is a hacking issue.

Try this but it's not tested.

In global.php find:

PHP Code:
  eval("\$headnewpm = \"".gettemplate('head_newpm')."\";");

Below it add:

PHP Code:
  $allpm=$DB_site->query_first("SELECT COUNT(*) AS messages,
                                SUM(IF(dateline>
$bbuserinfo[lastvisit] AND folderid=0,1,0)) AS newpm,
                                SUM(IF(messageread=0 AND folderid=0,1,0)) AS unreadpm
                                FROM privatemessage WHERE userid=
$bbuserinfo[userid] $ignoreusers");

  
$newpm['messages']=intval($allpm['newpm']);
  
$unreadpm['messages']=intval($allpm['unreadpm']); 
BEWARE! THIS WILL ADD 1 QUERY TO EVERY PAGE ON YOUR SITE!

- miSt
Reply With Quote
  #5  
Old 02-02-2003, 10:30 PM
AussieSat AussieSat is offline
 
Join Date: Apr 2002
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This what i use (no seperate template):

Place this in your phpinclude template..
PHP Code:
$headpms=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND messageread=0 AND folderid=0 $ignoreusers");
$headpmsmessage"You have $headpms[messages] new message(s)"
Place $headpmsmessage in your header (or anywhere else) to show the text "You have X new messages" (X being the new message count).
It does add a query to every page.

Just to hijack this thread for a related question..
I use images that change if there are new PMs (using a variant of the above code) - I want to have $headpmsmessage as the alt text for the images but I cant seem to get it to parse the variable. I know it can be done (a variable as alt text) as the header image uses $bbtitle for it's alt text.
Any ideas? Thanks.
Reply With Quote
  #6  
Old 02-27-2003, 04:17 PM
anders anders is offline
 
Join Date: Jan 2002
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Im having the same problem but with the following.

Code:
<tr id="cat">
<td bgcolor="{categorybackcolor}" colspan="6"><a href="private.php?s=$session[sessionhash]" title="Click Here to Open Your Private Messages $inboxname"><normalfont color="{categoryfontcolor}"><b>Private Messages</normalfont></b></a></td>

</tr>
<tr>
<td width="50" bgcolor="{secondaltcolor}" align="center" valign="top">
<img src="{imagesfolder}/$lightbulb.gif" alt=""></td>

<td width="453" bgcolor="{firstaltcolor}" align="left" valign="top">
<smallfont>$welcometext <b>$newposts</b></smallfont>

$headpmsmessage= "You have $headpms[messages] new message(s)";

<smallfont>Members: $numbermembers , Threads: $totalthreads , Posts: $totalposts<br>
Welcome to our newest member, <a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$newuserid">$newusername</a>
</smallfont>
</td>

<td bgcolor="{firstaltcolor}" colspan="5"><smallfont>
Your current private message status.<br>
<a href="private.php?s="><b>$newpm[messages]</b> : New messages.</a><br>
<a href="private.php?s="><b>$unreadpm[messages]</b> : Unread messages<br></a>
</smallfont></td>
</tr>
the pm part works but nr of posts, ?atest member, Threads etc dont.

and this is located inside "forumhome_pmloggedin"
Reply With Quote
  #7  
Old 02-27-2003, 05:42 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can't use the number of threads and posts etc in the forumhome_pmloggedin template. You can only use them in your forumhome template

Regards

- miSt
Reply With Quote
  #8  
Old 02-27-2003, 11:48 PM
anders anders is offline
 
Join Date: Jan 2002
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

impossible to make it work ? becouse i want that info to be seen ONLY by the registered ppl thats logged in besides the pm info,
Reply With Quote
  #9  
Old 03-02-2003, 10:58 AM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's not impossible to make it work. It just requires hacking and this is not the correct forum for hacking . I'm sure if you make a request in the requests forum for this someone wil help you out

- miSt
Reply With Quote
Reply


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 10:40 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.05904 seconds
  • Memory Usage 2,292KB
  • Queries Executed 22 (?)
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
  • (1)bbcode_code
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete