vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   PM 'You have X New Message(s)' relocation (https://vborg.vbsupport.ru/showthread.php?t=48422)

imageconstrux 02-02-2003 02:08 AM

PM 'You have X New Message(s)' relocation
 
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

Tony G 02-02-2003 02:58 AM

Hacking is probably required as that variable is only coded to work in that one template.

imageconstrux 02-02-2003 03:05 AM

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?

Dean C 02-02-2003 10:38 AM

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

AussieSat 02-02-2003 10:30 PM

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.

anders 02-27-2003 04:17 PM

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"

Dean C 02-27-2003 05:42 PM

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

anders 02-27-2003 11:48 PM

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,

Dean C 03-02-2003 10:58 AM

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

- miSt


All times are GMT. The time now is 03:30 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.00998 seconds
  • Memory Usage 1,744KB
  • 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
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete