Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Addons/Mods Graveyard (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=41)
-   -   A Enhanced PM System. (http://www.mysidiaadoptables.com/forum/showthread.php?t=837)

Bloodrun 05-17-2009 11:08 PM

A Enhanced PM System.
 
Enhanced PM System includes:
  • A more dynamic PM Read layout.
  • A better PM Notification.
  • A 'total pm' feature.

Preview:
(The missing 'have', is fixed within the coding. ;))
http://i42.tinypic.com/2mpznde.png
http://i40.tinypic.com/t9w9ld.png

Alrighty then, first things first. This modification, does not require any Database entries =D, kinda..

If you have installed my Forum Modification, you don't need mess around with your Database =D
This PM Enhancement, uses the 'postbar' feature from the Forum Modification, if you want details on how to 'install' the postbar feature(meaning the database part) go to this thread:
Forum Modification

Okay, so first go to your functions.php file, and find your sidebar function where it says:

PHP Code:


$msgctr 
"<a href='messages.php'>Visit Message Center</a><br>";

$query "SELECT * FROM ".$prefix."messages WHERE touser='".$loggedinname."' and status='unread'";
$result mysql_query($query);
$num mysql_numrows($result);

if(
$num 0){
$msgctr "<a href='messages.php'>Visit Message Center</a>(<b>".$num."</b>)<br>"

And replace that entire thing with this:

PHP Code:

$msgctr "<a href='messages.php'>Visit Message Center</a>(Unread: 0 | Total: 0)<br>";

$query "SELECT * FROM ".$prefix."messages WHERE touser='".$loggedinname."'";
$result mysql_query($query);
$num2 mysql_numrows($result);

if(
$num2 0){
$msgctr "<a href='messages.php'>Visit Message Center</a>(Unread: 0 | Total: ".$num2.")<br>";
}

$query "SELECT * FROM ".$prefix."messages WHERE touser='".$loggedinname."' and status='unread'";
$result mysql_query($query);
$num mysql_numrows($result);

if(
$num 0){
$msgctr "<a href='messages.php'>Visit Message Center</a>(Unread: <b>".$num."</b> | Total: ".$num2.")<br>"

The newly added query will help us get the 'total amount' of PM's that we have currently. (The total amount is based off of the PM's sent to you, not the PM's you have sent.)

Now, just for the sake of it, I am going to have you add the function that calls that 'postbar', you will be adding it right after your 'sidebar' function.

PHP Code:

function getpostbar($name){

include(
"config.php");

    
$query "SELECT * FROM ".$prefix."users WHERE username = '".$name."'";
    
$result mysql_query($query);
    
$num mysql_numrows($result);

    
$membersince=@mysql_result($result,$i,"membersince");
    
$displayquote=@mysql_result($result,$i,"displayquote");
    
$profilepic=@mysql_result($result,$i,"profilepic");

$postbar "
<span class='smalltext'>
<img src='"
.$profilepic."'><br>
<b>Member Since: </b><br>"
.$membersince."<br>
<b>Quote:</b><br>
"
.$displayquote."<br>
</span>
"
;

return 
$postbar;


Now, you make the 'postbar' contain whatever you want. But I had the 'postbar' act like that of an actual 'postbar' minus the posts. (For now ;) )

Okay, now you will need to add the following code, to any page you want your PM Notification to show up. You will need to paste at the of each page:

PHP Code:

if($isloggedin == "yes") {

$query "SELECT * FROM ".$prefix."messages WHERE touser='".$loggedinname."' and status='unread'";
$result mysql_query($query);
$num mysql_numrows($result);

if(
$num 0){
$msg "

<table width='450' border='1' cellpadding='3' cellspacing='1' bordercolor='1' bgcolor='#F9AE00'>
<td>
<table width='450' border='1' cellpadding='3' cellspacing='1' bordercolor='1' bgcolor='#FECF61'>
<tr>
<td><center>You a new message(s): <a href='messages.php'>Visit Message Center</a>(<b>"
.$num."</b>)<br></center></td>
</tr>
</table>
</table>"
;
}

$article_content "".$msg."<br>".$article_content."";


The Mysql query in this code, does the samething as the one in your 'sidebar' function, except the output is more.. attention seeking ;)

Now, the last thing(s) you have to do is replace your message.php file and your pmpost.php file, with these new message.php and pmpost.php files.

A little notice, the new message.php file, contains the neccesssary(sp) coding for my Report Member Modification. If you want that part of the code to work, you will need to 'install' my Warning System Modification, found here:
Warning System
If you don't want it, all you have to do, edit the out the link that takes the member to the reporting page.

Another notice, any link inside the new message.php file that goes to the profile, you will have to edit, because as it is currently the link will say profile2.php, You currently don't have (or shouldnt have) a file that says that, because I haven't 'release' my Custom Profile Modification yet.

(The reason I don't do this myself, is because I am trying to get you familiarized with the coding.)

Anywho, on to the pages you need to install:
[attachment=181][attachment=180][attachment=187]

SJC 05-18-2009 02:07 PM

RE: A Enhanced PM System.
 
Nice, I like how you made it like a forum topic (the design/ layout when viewing a PM).

Bloodrun 05-18-2009 02:27 PM

RE: A Enhanced PM System.
 
Quote:

Originally Posted by SJC
Nice, I like how you made it like a forum topic (the design/ layout when viewing a PM).

Lol, thats what I made it for ;)

SJC 05-18-2009 04:19 PM

RE: A Enhanced PM System.
 
For messages.php, it shows the content of the index.php page.

Bloodrun 05-19-2009 12:20 AM

RE: A Enhanced PM System.
 
Quote:

Originally Posted by SJC
For messages.php, it shows the content of the index.php page.

Then you have to do two things.

One, find where it says:

PHP Code:

$pagecontent getsitecontent("index");
$article_title $pagecontent[title];
$article_content $pagecontent[content]; 

and take out the:

PHP Code:

$pagecontent getsitecontent("index"); 

And number two, find your error in your script. Lol =/

If you paste it here, I can take a look at it for you.

Bloodrun 05-19-2009 12:25 PM

RE: A Enhanced PM System.
 
Oops, my apologies, the messages.php file that was originally there to download, wasn't the messages.php file at all. The correct file is there now. So everything should now work.

SJC 05-19-2009 02:51 PM

RE: A Enhanced PM System.
 
I'm getting this message:
PHP Code:

Fatal errorCall to undefined function getpostbar() in /home/a7685593/public_html/messages.php on line 194 


Bloodrun 05-19-2009 09:22 PM

RE: A Enhanced PM System.
 
Quote:

Originally Posted by SJC
I'm getting this message:
PHP Code:

Fatal errorCall to undefined function getpostbar() in /home/a7685593/public_html/messages.php on line 194 


Did you put the postbar function into your functions file?
If not, either put it in, or get rid of that part in your messages.php (though, thats the whole reason I made this).

SJC 05-19-2009 09:28 PM

RE: A Enhanced PM System.
 
Now I'm getting this:
Parse error: syntax error, unexpected T_ELSE in /home/a7685593/public_html/inc/functions.php on line 268
Do you want me to PM or post my funstions.php page?

Bloodrun 05-19-2009 09:29 PM

RE: A Enhanced PM System.
 
Quote:

Originally Posted by SJC
Now I'm getting this:
Parse error: syntax error, unexpected T_ELSE in /home/a7685593/public_html/inc/functions.php on line 268
Do you want me to PM or post my funstions.php page?

Post it, unless there are things you dont want people to see in it.


All times are GMT -5. The time now is 07:30 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.