ThreadsDev FusionBB Greeting Cards FusionBBDev.com Measurection.com VertexHost NASCAR Racing MouseFunFacts.com Myrtle Beach Info UBB.Threads Modifications threadsdev.net
FusionBB

Trans-D Tropin
Use Coupon Code '1004' to Save $20 Off Your Initial Order of Trans-D Tropin®
V6 Threads Development >> Modifications

Pages: 1
bostongio
Lurker


Reged: 09/30/04
Posts: 8
Beta-[6.4] Paginate PMs
      #128383 - 06/20/05 06:06 PM

Mod Name / Version: Paginate PMs

Description: This mod puts your PMs into pages (much like forum threads are), which is especially helpful to your users who keep a lot of their PMs lying around.

This code is a simple cut and paste from this functionality found within postlist.php, adapted for use with PMs.



Working Under: UBB.Threads 6.4

Mod Status: Beta

Any pre-requisites:

Author(s): bostongio

Date: 06/20/05

Credits: UBBthreads

Files Altered: viewmessages.php
templates/default/viewmessages.tmpl

New Files:

Database Altered: No

Info/Instructions: In viewmessages.php

Find:

Code:

// ---------------------------------------------------------
// Ok, we found the profile, now lets put it all onto a page
$html -> send_header("$ubbt_lang[$box]",$Cat,0,$user);



Replace with:

Code:

// ---------------------------------------------------------
// Ok, we found the profile, now lets put it all onto a page
$html -> send_header("$ubbt_lang[$box]",$Cat,0,$user);


// -----------------------------------------
// Find out how many posts to show per page
if (!$PostsPer) {
$PostsPer = $theme['postsperpage'];
}

// ---------------------------------------------------------------------
// Now we calculate which posts to grab for this page. We want to grab
// one from the previous page and one from the next page so we know what
// the previous and nexts posts will be
if (!($page > 0)) {
$Totalgrab = $PostsPer + 1;
$Posts = $PostsPer + 1;
}
else {
$Startat = $page * $PostsPer;
$Posts = $PostsPer + 1;
$Totalgrab = "$Startat, $Posts";
}

$endpage = 1;
$limit = "LIMIT $Totalgrab";




-------------------------------------------------------------------
Find:

Code:

// -------------------------
// Get any private messages.
$username_q = addslashes($Username);
$query = "
SELECT t1.M_Status, t1.M_Subject, t1.M_Sender, t1.M_Sent, t1.M_Number, t2.U_Username
FROM {$config['tbprefix']}Messages AS t1,
{$config['tbprefix']}Users AS t2
WHERE t1.M_Uid = '{$user['U_Number']}'
AND t1.M_Status $extra 'X'
AND t1.M_Sender = t2.U_Number
ORDER BY t1.M_Sent DESC
";
$sth = $dbh -> do_query($query);

$i = 0;



Replace with:

Code:


// -------------------------
// Get any private messages.
$username_q = addslashes($Username);
$query = "
SELECT t1.M_Status, t1.M_Subject, t1.M_Sender, t1.M_Sent, t1.M_Number, t2.U_Username
FROM {$config['tbprefix']}Messages AS t1,
{$config['tbprefix']}Users AS t2
WHERE t1.M_Uid = '{$user['U_Number']}'
AND t1.M_Status $extra 'X'
AND t1.M_Sender = t2.U_Number
ORDER BY t1.M_Sent DESC
$limit
";
$sth = $dbh -> do_query($query);

$i = 0;

// -------------------------------------------------------------------
// If $page is greater than 0 then we need a link to the previous page
if ($page > 0) {
$prev = $page - 1;
$prevstart = "<a class=\"noun\" href=\"{$config['phpurl']}/viewmessages.php?Cat=$Cat&amp;box=$box&amp;page
=$prev&amp;sb=$sb&amp;o=$o\">";
$prevoption = "previous.gif";
$prevstop = "</a>";
}
else {
$prevoption = "greyprevious.gif";
}

// ----------------------------------------------------------------------
// If total parent posts is greater than $PostsPer*Page then we give them
// a link to the next page
if ($nums >= ($PostsPer + 1) ) {
$next = $page + 1;
$nextstart = "<a class=\"noun\" href=\"{$config['phpurl']}/viewmessages.php?Cat=$Cat&amp;box=$box&amp;page
=$next&amp;sb=$sb&amp;o=$o\">";
$nextstop = "</a>";
$nextoption = "next.gif";
}
else {
$nextoption = "greynext.gif";
}




--------------------------------------------------------------------
Find:

Code:

$messagesize = "0";
if (isset($message)) {
$messagesize = sizeof($message);
}



Replace with:

Code:

$messagesize = "0";
if (isset($message)) {
$messagesize = sizeof($message);
}

$query = "
SELECT COUNT(*)
FROM {$config['tbprefix']}Messages AS t1,
{$config['tbprefix']}Users AS t2
WHERE t1.M_Uid = '{$user['U_Number']}'
AND t1.M_Status $extra 'X'
AND t1.M_Sender = t2.U_Number
";
$sth = $dbh -> do_query($query);
list($totaltopics) = $dbh -> fetch_array($sth);
$dbh -> finish_sth($sth);

$Threads = $totaltopics;
$TotalP = ceil($Threads/$PostsPer);
if ($TotalP > 0) { $pagejumpers = "Page "; }

$Startpage = $page - 5;
$Endpage = $page + 5;

if ($Startpage < 0) {
$Endpage = $Endpage - $Startpage;
$Startpage = 0;
}
if ($Endpage > $TotalP) {
$Endpage = $TotalP;
$Startpage = $Endpage - 10;
}
if ($Startpage < 0) { $Startpage = 0; }
if ($Startpage > 0) {
$midprint = intval($Startpage / 2) - 1;
$pagejumpers .= "<a href=\"{$config['phpurl']}/viewmessages.php?Cat=$Cat&amp;page=0&amp;box=$box&amp;sb=$sb&am
p;o=$o\">1</a> ";
$pagejumpers .= "<a href=\"{$config['phpurl']}/viewmessages.php?Cat=$Cat&amp;page=$midprint&amp;box=$box&amp;sb=
$sb&amp;o=$o\">...</a> ";
}
if ($Threads > $PostsPer) {
for ($i = $Startpage; $i <= $Endpage; $i++) {
$printedpage = $i + 1;
if ($i == $page) {
$pagejumpers .= "<strong>[$printedpage]</strong> ";
} else {
if ($printedpage <= $Endpage) {
$pagejumpers .= "<a href=\"{$config['phpurl']}/viewmessages.php?Cat=$Cat&amp;page=$i&amp;view=$view&amp;box=$box
&amp;sb=$sb&amp;o=$o\">$printedpage</a> ";
}
}
}
}
else {
$pagejumpers .= "1";
}
if ($Endpage < $TotalP) {
$Totalprint = $TotalP - 1;
$midprint = $TotalP - intval(($TotalP - $Endpage) / 2);
$pagejumpers .= "<a href=\"{$config['phpurl']}/viewmessages.php?Cat=$Cat&amp;page=$midprint&amp;box=$box&a
mp;sb=$sb&amp;o=$o\">...</a> ";
$pagejumpers .= "<a href=\"{$config['phpurl']}/viewmessages.php?Cat=$Cat&amp;page=$Totalprint&amp;box=$box
&amp;sb=$sb&amp;o=$o\">$TotalP</a> ";
}
$pagejumpers .= "</font>";




===============================================================

In templates/default/viewmessages.tmpl

Find at the bottom of the file:

Code:

</td>
</tr>
$tbclose

</form>
UBBTPRINT;
/* UBBTREMARK */ ?>



Replace with:

Code:

</td>
</tr>

<tr>
<td colspan="8" class="tdheader" align="right">
$pagejumpers
</td></tr>

$tbclose

</form>
UBBTPRINT;
/* UBBTREMARK */ ?>






Disclaimer: Please backup every file that you intend to modify.
If the modification modifies the database, it's a good idea to backup your database before doing so.

Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.


Post Extras: Print Post   Remind Me!   Notify Moderator  
AllenAyres
Wizard
****

Reged: 10/12/01
Posts: 5562
Loc: Texas
Re: Beta-[6.4] Paginate PMs [Re: bostongio]
      #128386 - 06/21/05 12:13 AM

danke

--------------------
- Allen

- Join Team ThreadsDev

- It's not about you.


Post Extras: Print Post   Remind Me!   Notify Moderator  
StanCA
Power User


Reged: 07/01/02
Posts: 65
Re: Beta-[6.4] Paginate PMs [Re: AllenAyres]
      #128392 - 06/21/05 04:57 PM

this will work with 6.5.1??? right??

--------------------
http://IsThereSexAfterDeath.com
http://clubadventist.com
( I like to check out the toys others have added )


Post Extras: Print Post   Remind Me!   Notify Moderator  
bostongio
Lurker


Reged: 09/30/04
Posts: 8
Re: Beta-[6.4] Paginate PMs [Re: StanCA]
      #128400 - 06/22/05 07:19 AM

I don't have copies of other version of the software, just my 6.4.x version. I'm not sure how much of significance changed between the two versions in viewmessages.php, as that's the key file.

Post Extras: Print Post   Remind Me!   Notify Moderator  
StanCA
Power User


Reged: 07/01/02
Posts: 65
Re: Beta-[6.4] Paginate PMs [Re: bostongio]
      #128406 - 06/22/05 09:56 AM Attachment (18 downloads)

getting this message in 6.5.1

--------------------
http://IsThereSexAfterDeath.com
http://clubadventist.com
( I like to check out the toys others have added )


Post Extras: Print Post   Remind Me!   Notify Moderator  
AnnoModerator
Code Monkey
****

Reged: 05/23/01
Posts: 648
Loc: Austria
Re: Beta-[6.4] Paginate PMs [Re: bostongio]
      #128435 - 06/23/05 08:03 AM

I knew I have seen this already:
http://www.threadsdev.net/forum/showflat.php/Number/85383

--------------------
The Rich Jerk
Google Cash

Subforums for UBBThreads
Fungifun


Post Extras: Print Post   Remind Me!   Notify Moderator  
bostongio
Lurker


Reged: 09/30/04
Posts: 8
Re: Beta-[6.4] Paginate PMs [Re: Anno]
      #128441 - 06/23/05 04:34 PM

Hmm, I couldn't find that but glad to see others were thinking the same thing. That one only went up to 6.3, so here's the answer for 6.4. 6.5 anyone?

Post Extras: Print Post   Remind Me!   Notify Moderator  
AnnoModerator
Code Monkey
****

Reged: 05/23/01
Posts: 648
Loc: Austria
Re: Beta-[6.4] Paginate PMs [Re: bostongio]
      #128449 - 06/24/05 02:35 AM

2 issues:

1. In viewmessages.php you are using the variable $nums which is not defined.

2. In viewmessages.tmpl you are not useing the variables $prevoption and $nextoption

--------------------
The Rich Jerk
Google Cash

Subforums for UBBThreads
Fungifun


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 17 anonymous users are browsing this forum.

Moderator:  JoshPet, Gardener, Ian_W, Anno 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 3757

Rate this topic

Jump to
 
Hot Topic
No posts have caught fire as of yet.

Developers for Hire
Are you looking for custom modifications? Upgrades? Installs?
We have developers who can help!
View Our Services Page for information.

Login
Enter your username and password to login. If you do not have a username you can register one HERE.
username:
password:

Send Password
Remember Me

Online
115 guests have been online with in the last 90 minutes.

ThreadsDev.com
Trans-D Tropin

Current Threads
No current threads found...

Modifications
Recently Added:
· View Private Messages v0.9.3
· Stop Guests from seeing "Who's Online." [6.5.5]
· User List Display Limited by Post Count 1.0
· Paginate PMs 1.0
· Today and Yesterday

Most Downloaded:
· Inline Images 3.1
· Quote Username 1.0
· Games Arcade Deluxe v1.8
· UbbThreads and Photopost Total Integration Version 4
· Tool Tip Body Preview 3.0

Highest Rated:
· Mass Threads Move for 6.3
· Update Last Posts 1.0
· Update B_Parent User 1.0
· Integrated Index Page (IIP) 5.3.1
· IIP SideBarPal 1.1

Recent Stylesheets:
· Mix-Colors_2-0_3D for UBBT v6.3 - 6.5
· Mix-Colors_2-0 for UBBT v6.3 - 6.5
· Dark-Grey_3-0 for UBBT v6.3 - 6.5
· Green-Orange_1-0 for UBBT v6.3 - 6.5
· ebay_1-0 for UBBT v6.3 - 6.5

Recent Template Mods:
· Postlist modification - line separates new topics and replies
· I need some help with my postlist.tmpl file
· Edit, reply, and quote buttons mod for Facelift 6.5
· Google Add Sense add on for Threads 6.5
· Article templates for Thread 6.5

Shout Box

Short Stats
New Members:
4 Last 24 hours
20 Last 7 days
107 Last 31 days

Boards:
11676 Total topics
73324 Total replies

Totals:
5728 Members
85000 Posts

Max Online:
814 Total
(06/01/06 09:46 AM)


Web Hosting Provided by
VertexHost Web Hosting

Content ©2003-2006 ThreadsDev.NET
Powered By UBB.threads™ 6.5.5

 .: IIP 5.5 by David Lozier ©2003 :. 
Distributed by ThreadsDev.net

Visit Our Sister Sites!
JoshuaPettit.com and ThreadsAddons.com
Web Hosting Provided by
VertexHost Web Hosting

Generated in 0.301 seconds in which 0.275 seconds were spent on a total of 26 queries. Zlib compression enabled.


Whiplash Claims - Stacking Rings - Jewellery - Whiplash