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)
-   -   Last PM on Forumhome (https://vborg.vbsupport.ru/showthread.php?t=47900)

Kratheous 01-18-2003 10:00 PM

Last PM on Forumhome
 
This hack will show you last PM you recieved on the forumhome.

Kratheous 01-19-2003 09:00 PM

Screenshot:

Disturbed 01-20-2003 03:13 AM

nice, thanks for sharing ^^

Sebastian 01-20-2003 07:59 AM

it doen't work for me.. no errors, just says i have no new pms when i do. v229

Floris 01-20-2003 07:59 AM

Great, I will install it right away, nice little hack! simple/easy/effective :)

Floris 01-20-2003 08:05 AM

floris - You have 1 new message(s) since your last visit.
(You have 1 unread messages and 42 total messages in all your folders.)
You have no Private Messages in your inbox at the moment.

Uhm, doesn't seem to be working though :> vB 2.2.9

Floris 01-20-2003 08:16 AM

inph from the irc informed me to also add the templates that are used into the $templatesused=' bit.

So, find:

$templatesused=' (in the top of index.php)

and at the end of the line, replace:
';
with:
,forumhome_pmlastno,forumhome_pmlast';

Boofo 01-20-2003 08:37 AM

Well, it works for me, almost. It says the last message title correct but is has ARRAY as the user the message is from (and there is no such user on my board). Also, the message it is picking up was moved out of the Inbox into another folder. Is it supposed to show only pms in your inbox?

inphinity 01-20-2003 08:48 AM

i think $lastpmuser should be referenced as:
PHP Code:

<br><br><b>Latest Private Message:</b$lastpmstuff[titleby $lastpmuser['username'

also it is the last pm recieved in all folders

you could limit it to inbox by adding folderid = 0 after WHERE in the $lastpmstuff query

Boofo 01-20-2003 09:06 AM

Should it look like this?

PHP Code:

$lastpmstuff=$DB_site->query_first("SELECT * FROM privatemessage WHERE folderid = 0 userid=$bbuserinfo[userid] and fromuserid!=$bbuserinfo[userid] $ignoreusers ORDER BY dateline DESC LIMIT 1"); 


inphinity 01-20-2003 09:36 AM

put an 'and' in there as well

folderid = 0 AND userid=$bbuserinfo[userid]

Boofo 01-20-2003 09:41 AM

Thank you very much. ;) Would there also be a way to pull out the name of the folder the message is in, too?

inphinity 01-20-2003 10:46 AM

PHP Code:

  if ($bbuserinfo[pmfolders]) {
    
$allfolders explode("\n"trim($bbuserinfo[pmfolders]));
    while (list(
$key,$val)=each($allfolders)) {
      
$thisfolder explode("|||"$val);      
    }
  }

$thisfolder[$folderid] = name of folder message is in
$thisfolder
[0] (inboxhas a name of "1"

pm folder names are kept in the user table 


Boofo 01-20-2003 10:57 AM

Quote:

Originally posted by inphinity
PHP Code:

  if ($bbuserinfo[pmfolders]) {
    
$allfolders explode("\n"trim($bbuserinfo[pmfolders]));
    while (list(
$key,$val)=each($allfolders)) {
      
$thisfolder explode("|||"$val);      
    }
  }

$thisfolder[$folderid] = name of folder message is in
$thisfolder
[0] (inboxhas a name of "1"

pm folder names are kept in the user table 


I kind of follow you on this. I put the first 6 lines in but I got lost with the last two lines. :) What would be the complete code I need to do it?

mauce 01-20-2003 11:36 AM

So how would the hack look like in total?
I'm kinda confused now.

Corrupter 01-21-2003 07:00 AM

Mine is showing last PM by ARRAY..

Do you have the correct code for this?

Corrupter 01-21-2003 07:06 AM

Nevermind..

The correct code for template: forumhome_pmlast

Code:

<br><b>Latest Private Message:</b> $lastpmstuff[title] by $lastpmuser[username]
See Image:

Kratheous 01-21-2003 03:01 PM

Hmmm... Indeed. Sorry about that.

Other than that, it should've worked. My friend's running it (that's where I got the screenie from.. haven't reinstalled it on my own boards, yet. @_@)

Boofo 01-21-2003 03:24 PM

Is there a way to have this link to the last message shown so all you have to do is click on the link to bring the message up?

Kratheous 01-21-2003 03:33 PM

Yep.

Replace:

$lastpmstuff[title]

With:

<a href="./private.php?s=$session&action=show&privatemessagei d=$lastpmstuff[privatemessageid]">$lastpmstuff[title]</a>

Boofo 01-21-2003 03:45 PM

Excellent! Thank you. Great hack! ;)

Sebastian 01-21-2003 05:11 PM

Quote:

Originally posted by Kratheous
Hmmm... Indeed. Sorry about that.

Other than that, it should've worked. My friend's running it (that's where I got the screenie from.. haven't reinstalled it on my own boards, yet. @_@)

but it doesn't work, if you haven't install it then do so, then tell me if it works. 1 person out of 10 got it to work in this thread, doesn't that tell you something? :ermm:

Boofo 01-21-2003 05:15 PM

Do you have any hacks installed that might be messing with it? I have alot of hacks installed and it works great here.

Kratheous 01-21-2003 05:30 PM

I just installed it on a 2.2.9 and it does work. No hitches, except the one "array" thing, which has been fixed in the posts above. I can't think of a reason where it shouldn't.

Boofo 01-21-2003 06:14 PM

Kratheous, don't forget to update the first post with the Array fix. :) I am running a heavily hacked v2.2.9 and it works fine here, too. Also, I adapted it to work on my vbHome lite page as well.

By the way, the code you gave me for the link to the Latest Private Message was missing a sessionhash. :)

This:

Quote:

<a href="./private.php?s=$session&action=show&privatemessagei d=$lastpmstuff[privatemessageid]">$lastpmstuff[title]</a>
Should be this:

Quote:

<a href="./private.php?s=$session[sessionhash]&action=show&privatemessageid=$lastpmstuff[privatemessageid]">$lastpmstuff[title]</a>

Slynderdale 01-22-2003 07:43 PM

Ok heres a fix i made to the hack, it uses just 1 query instead of 2, i also added support for firefly's private attachment hack, it also gets the folder name the pm is in, it links the user who sent you the pm to there profile and it also links the message to the pm itself, i fixed up the code and templates, ill post a screenshot below and in the next post the fix. enjoy.

Slynderdale 01-22-2003 07:43 PM

You can find the updated fixed file that shows the correct folder name here:
https://vborg.vbsupport.ru/showthrea...000#post345000

MetroSports82 01-22-2003 10:45 PM

um.. not working. I'm getting this message, with new pm's?

Quote:

You have no PMs in your inbox!

Slynderdale 01-22-2003 11:00 PM

Quote:

Originally posted by MetroSports82
um.. not working. I'm getting this message, with new pm's?


Hmm, im using it right now and it works, the new pm must be from some one else, not the same user that your checking the pm from, so if you tested by messaging yourself it wont show up as a new pm.

Kratheous 01-22-2003 11:03 PM

Yes, at the time I made this hack, I hadn't discovered joins... it's actually a few months old... *shrugs* And I must be out of it this week, excuse my lack of full variables. @_@

MetroSports82 01-22-2003 11:07 PM

Quote:

Originally posted by Slynderdale


Hmm, im using it right now and it works, the new pm must be from some one else, not the same user that your checking the pm from, so if you tested by messaging yourself it wont show up as a new pm.

LoL! Doh!! :D it works now. thanks, great hack! ;)

Boofo 01-23-2003 12:05 AM

Quote:

Originally posted by Slynderdale
Heres the fix.
Thank you, sir, for the folder name addition. Was looking for that one. ;)

Boofo 01-23-2003 02:10 AM

Quote:

Originally posted by Slynderdale
Heres the fix.
The foldername is always Inbox when the last message I have is in another folder. It's not showing the folder the actual message is in. Any fix for this?

Slynderdale 01-23-2003 02:18 AM

Quote:

Originally posted by Boofo


The foldername is always Inbox when the last message I have is in another folder. It's not showing the folder the actual message is in. Any fix for this?

Hmm, ill fix that now

Slynderdale 01-23-2003 03:34 AM

Ok, i saw whats wrong and I fixed it and tested it, this now shows the correct folder name its in, enjoy.


Updated, see this post:
https://vborg.vbsupport.ru/showthrea...675#post394675

Boofo 01-23-2003 05:17 AM

Thank you again, sir. ;)

mauce 01-23-2003 09:47 AM

eeeh.... may I ask.
Can the folders be made clickable (to make it browse to that folder) as well..

(some people are never satisfied, duh?)

Slynderdale 01-23-2003 10:29 AM

Quote:

Originally posted by mauce
eeeh.... may I ask.
Can the folders be made clickable (to make it browse to that folder) as well..

(some people are never satisfied, duh?)

in forumhome_pmlast find:

in folder $lastpmstuff[foldername]


change it to:

in folder <a href="private.php?s=$session[sessionhash]&folderid=$lastpmstuff[folderid]">$lastpmstuff[foldername]</a>

I also updated the text file with this.

Slynderdale 05-13-2003 07:13 PM

Its been a while, any ways, Added a small add on that shows the first 300 chracters of the private message on forumhome.

Boofo 05-13-2003 07:18 PM

Welcome back, my friend. ;)


All times are GMT. The time now is 02:45 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.01246 seconds
  • Memory Usage 1,825KB
  • 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
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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