Messaging System

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Dr. D
Forum Newbie
Posts: 2
Joined: Mon Jun 17, 2002 4:25 pm

Messaging System

Post by Dr. D »

Hi everybody,
I created some sort of a Messaging System and I'm having the problem now, that if you've got more than 29 sites of messages, it's getting to "wide".

Therefore I want to include an indication of page number that should look like this:

Site: 1|...|current site -2 | current site -1 | current site | current site +1 | current site +2| ...|last site

At present the side view is solved still in such a way:

Code: Select all

for($x = 0; $x < $count; $x += $messagespersite)
&#123;
$y = ($x / $messagespersite) + 1;
if($x == $site)
$sites .= '&nbsp;'.$y;
else
$sites .= '&nbsp;<A href="?menu=login&submenu=messages&site='.$x.'" >'.$y.'</a>';
&#125;

So only the number of messages ($$count) and the maximally indicated messages per side ($$messagespersite) are handed over.

I'd be very glad if one of you could at least help me solving this difficulties :!:
User avatar
e+
Forum Commoner
Posts: 44
Joined: Mon Jun 17, 2002 7:07 am
Location: Essex, UK

Post by e+ »

are the messages stored in a database so you can assign a message number to each message?
Dr. D
Forum Newbie
Posts: 2
Joined: Mon Jun 17, 2002 4:25 pm

Post by Dr. D »

They aren't stored in a database, but nevertheless the've got a number:
:arrow: one line = one message
Post Reply