Jump to content
The Uniform Server Community

Showing topics/replies...


Tucker
 Share

Recommended Posts

Hey, you know forums when a new post/topic is made within a category, during the time a user was NOT logged in. When the user logs in, it will display where the categoryies are shown, the categories which have new posts/topics, when we we that category, it will show the topics which we HAVE not read since we last logged in. Now, I know how to make it appear that it was new, but how do we make it that when we view it, and then go back to the front page, will will no longer show it have new posts/topics, without having to log off?

 

Btw for me to get the current posts/topics shown I go against the last session so yeah.

Link to comment
Share on other sites

It depends on what kind of active topic you are making. If you are making it per user then that is different; if you are making it per forum then just put it by the post's table/row.

 

By saying per user i meant that it will tell the user if he or she ha viewed the topic. As in here on our IPB, when you click View New Posts.

 

For the forum, it is basically easy. Meaning someone has viewed the post so it is not new... people do not use this much.. the use the user option.. but then it is also complicated...

Link to comment
Share on other sites

per user, so yes the idea is a little different. So yeah.... this part is really annoying me, coz its the last part that I need to get working.

Link to comment
Share on other sites

Well this part can be done any how.... take a look at how IPB or phpBB does theirs.... for my forum that i am working on, i have not reached this part yet... :D

Link to comment
Share on other sites

I have, but I got no where, lost infact... The only thing i was able to adapt from looking at theirs was getting it to show new topics after logging on. Followed similar procedures and it either messed up the system or errors... Oh i havent looked in IPB, but where do I look to find it?

Link to comment
Share on other sites

I thought I replied to this, ahh yes, I know but I have a copy of it, the latest one, I'm a client, but I still dont understand how they operate for phpbb and for IPB dont know where to look for the code.

Link to comment
Share on other sites

Yes i saw your last post but it must have been late before the move. :D

 

Anyways, you do not need to look at their source code, looking into IPB's source code is like taking a trip in a maze.... Just look at the database and how they did it. They always use the database to do all that kind of stuff.

Link to comment
Share on other sites

Just search google... there are a bunch of sites that still give you free IPB 1.3 or 2.0(Trial) Final.

863[/snapback]

Do you by any chance know of a site that still offers version 2 unlimited trial for download? Apparently for the first couple hours, version 2 had an free unlimited trial, then they changed it to the limited trial.

Link to comment
Share on other sites

they appear to use last_activity session or some short, so do they like use both last_visit and last_activity and run it against each other to determind the post they have looked at? but that only sloves half the problem...

 

but then they use a new table called topic_read, and that contains info when they read the page, man that is so cheap... lol... well i will tell you if this works. hopefully it does.

Link to comment
Share on other sites

Do you by any chance know of a site that still offers version 2 unlimited trial for download? Apparently for the first couple hours, version 2 had an free unlimited trial, then they changed it to the limited trial.

874[/snapback]

 

I had submitted my copy to a guy who asked for it cause he wanted to put it up on a site for people to download, but i never got the site and do not know his email anymore. I deleted my copy after that. Search Google.. you will find it. Believe me... :D

 

Tucker: tell me if it works :D

Link to comment
Share on other sites

It works! Man that is awsome, thanx for the help. btw you mentioned about doing a forum? curios, how are you going to go about doing this?

Link to comment
Share on other sites

umm.. isn't that what you are doing? Making a Forum. Thats what i am working on right now but i have put it on hold for a while cause of everything going on.... :D

Link to comment
Share on other sites

I know, but you said

 

for my forum that i am working on, i have not reached this part yet...

 

So I was curious that is all... btw, i'm not going to open a new topic for the heck of it. Ok I have done this permission system that is short of lie IPB, using a colomn to place the information in a form o a string. Now when I grab the info I have to use the explode function than place it a loop. Than I use the explode function again.

 

Anyway this is my line of working

$array= 'glb:0:0:0:0:0;mod:0:0:0:0:0;usr:0:0:0:0:0;vis:0:0:0:0:0';

$array = explode(';', $array);
$glb = explode(':', $array[0]);

if ($glb[2] == 0)
{
code...
}

 

Is there a way to some how convert that to an associative array?

This way I dont have to remember that $glb[1] is for show forum, and $glb[2] is read topics, but instead have it show $auth[name][id] instead...? anyway ideas how to go about that?

Link to comment
Share on other sites

It looks like u already converted it to an array... didn't you get the explode function to work.. (not so good when it comes to explode *cough* took me an hour to get 1 single stupid explode function to work...)

 

What you could do is start a new array *simple and lazy way*, 4 arrays..

 

$glb = array (
  1 => '0',
  2 => '0',
  3 => '0',
  4 => '0',
);

$mod = array (
  1 => '0',
  2 => '0',
  3 => '0',
  4 => '0',
);

$usr = array (
  1 => '0',
  2 => '0',
  3 => '0',
  4 => '0',
);

$vis = array (
  1 => '0',
  2 => '0',
  3 => '0',
  4 => '0',
);

 

This method is much more easy and clean, just as it is lazy.. :D

Link to comment
Share on other sites

Lol... Well the $array is suspose to be info I grab from the db, I just left that part out.

 

I want to be able to do this instead $auth['glb']['read'] instead of $glb['2']

Link to comment
Share on other sites

2D Arrays.... not on my speed yet.. that is still on my to-learn list for PHP. I know how to use it in Java but not in PHP yet...

 

*cough, if only i had listened in AP Prog, i might still remember how it works for Java*

Link to comment
Share on other sites

Lol... Well I am experimenting with some other way to write that out, perhaps if I do it in a loop? Would that work? something like this:

 

while ( $array )

{

$auth[$array['name']] = $array[value'];

}

 

something like that? It's probally wrong, but yeah.

Link to comment
Share on other sites

Well, after working on it for quite some time, and yes what you said was true, it went on, like and endless loop, however, I did this.

 

   $array= 'glb:0:0:0:0:0;mod:0:0:0:0:0;usr:0:0:0:0:0;vis:0:0:0:0:0';
   $array = explode(';', $array);
   foreach ($array as $key => $value)
   {

   $array = explode(':', $value);
   $$var =  $array[0];

   for ( $i=1; $i <= 5; $i++)
   {
       if ( $i == 1 )
       {
           $type = 'view';
       }
       else if ( $i == 2 )
       {
           $type = 'read';
       }
       else if ( $i == 3 )
       {
           $type = 'post';
       }
       else if ( $i == 4 )
       {
           $type = 'reply';
       }
       else if ( $i == 5 )
       {
           $type = 'upload';
       }
       $perm_auth[$$var][$type] = $array[$i];
   }

 

Now, my next mission is to cut that if statements to a shorter statement. Is that possible?

Link to comment
Share on other sites

lol.. you can try and use switch... but i do not know if PHP has that... also got that one from Java...

 

*wow, i really learnt something usefull in AP Java*

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...