Jump to content

Alex007152

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Alex007152's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Any idea's on how to do it with a db or flatfile for persisten storage? Sessions didnt seem to work, just gave it a try though . Anyway, i'm using MySQL. I could do it with a db but im a bit concerned about the webspace it could take.
  2. Hi, I'm having some trouble with tracking user information. I'm currently stuck with the forums on my gaming website, i need to track what topics have been read by the user and wich topics are yet to be read. (e.g. newly created topics appear as "not read yet" to whoever hasn't read the topics). I've tried numerous way's to do this with sessions but it didnt turn out very well. I see boards everywhere displaying correctly wich topics i haven't read yet and wich i have read already. Any idea's on how to do this? I'd greatly appreciate all help to solve this problem.
  3. Perhaps theres an alternative method to do this? I basicaly need to get new topics indicating their new. For instance, a red button indicates the button is new, a blue button indicates its read or old. The problem is that my script automaticaly displays blue buttons (indicating the topic is read or old) when the session is not set or set as "Read", as the session will be deleted in time and thus not set (since it would take relatively few people to fill my web storage with sessions if they wouldnt be deleted) so i decided to give the user 7 days to read the topic or it's session will automaticaly be deleted and thus the blue button will be rendered. The problem is that i dont know how to give new topics a value so that they will be rendered red. If you know an alternative menthod please let me know, i urgently need to get this right. Thanks
  4. Hi, i'm stuck with my sessions on my new forum. When a new topic has been posted, the script automaticaly creates a new session saying the topic has not yet been read: $_SESSION["Topic $topic"] = "Not Read"; Wich is obviously changed to "Read" as soon as the user gets redirected to his new topic. However, to everyone else this session obviously does not have a value when it's created. I basicaly need to give the session the value "Not Read" when it's created and that it appears so to everyone else. Never done this before, not sure how to. I've tried some database changes but that didnt work it out. Any idea's? Thanks allot in advance.
  5. Probably quite long but this is some code i found some while ago when i had the same problem, if appropriate it copy's the entire url of the current page and puts it in $fullURL. $_SERVER['FULL_URL'] = 'http'; $script_name = ''; if(isset($_SERVER['REQUEST_URI'])) { $script_name = $_SERVER['REQUEST_URI']; } else { $script_name = $_SERVER['PHP_SELF']; if($_SERVER['QUERY_STRING']>' ') { $script_name .= '?'.$_SERVER['QUERY_STRING']; } } if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') { $_SERVER['FULL_URL'] .= 's'; } $_SERVER['FULL_URL'] .= '://'; if($_SERVER['SERVER_PORT']!='80') { $_SERVER['FULL_URL'] .= $_SERVER['HTTP_HOST'].':'.$_SERVER['SERVER_PORT'].$script_name; } else { $_SERVER['FULL_URL'] .= $_SERVER['HTTP_HOST'].$script_name; } $_SESSION['thePageURL'] = $_SERVER['FULL_URL']; $fullURL = $_SESSION['thePageURL']; Hope it helped.
  6. No. I tried that but it obviously had the same result. I'm going on vacation tomorow, it's too bad i didn't had the time to fix it before i have to go but i'll be looking on internet for information on the bug on internet clubs orso. I urgently need to find a way to get this to work because i'm afraid i can't continue the development of my site without having this fixed. I'd extremely highly appreciate it if someone could tell a way to work around it.
  7. Thank you for the suggestion, i could try that if there is no other alternative way. I have to disagree; PHPBB for instance seems to have worked around it somehow. This should be their code that increments the field topic_views: // // Update the topic view counter // $sql = "UPDATE " . TOPICS_TABLE . " SET topic_views = topic_views + 1 WHERE topic_id = $topic_id"; if ( !$db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Could not update topic views.", '', __LINE__, __FILE__, $sql); } I do hope however that it's indeed due to FireFox and that it will handle the code correctly..
  8. Hi, I started a thread on a firefox issue with a php script recently, i'm still stuck for example with this script to increment the views of a topic: mysql_query("UPDATE `forum_topics` SET topic_views=topic_views+1 WHERE topic_id='$TopicID'"); Firefox is probably not the only browser that loads pages more then once by default. The problem with this script for example is that i want it to increment the views once the visitor actually opens the topic, not when the browser loads it multiple times wich results in invalid views. So now i'm wondering if there's a way to run scripts on a page once, only when the visitor actually opens the page. I've tried include_once() but the browser included it twice anyway. Thanks allot in advance.
  9. It doesn't here, with FireFox atleast. I've had this before with some pages, especially when it takes long for them to load and at some point the browser decides to download the page for some reason. Not sure why.
  10. Hi again, i looked up some code on my old PHPBB forum, heres the part that increments the views: // // Update the topic view counter // $sql = "UPDATE " . TOPICS_TABLE . " SET topic_views = topic_views + 1 WHERE topic_id = $topic_id"; if ( !$db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Could not update topic views.", '', __LINE__, __FILE__, $sql); } It works fine, apparantly, no matter how high "network.http.max-persistent-connections-per-server" is set. According to another member from the firefox forums, it also has something to do with empty src attributes with images, making standard browsers load the page multiple times. Checked all src attributes and everything was fine however. Any idea's on how to work around it?
  11. Thanks ALLOT for pointing that out! I'm just not sure how to write a script that deals with it though, any suggestions?
  12. I was thinking that aswell, but heres a responce from someoone from the firefox forums:
  13. Thank you for your reply. Heres a sample forum with a sample topic: http://www.mmorpghq.net/games/?GameID=3&Content=Topics&Forum=1 Caesar: I'll try that in a second, thanks.
  14. Hi, I've desperately searched on this one for hours and it has frustrated me to no end. I've contacted my webhost, posted it on the firefox forums but they all point at the script self. Here's the code: $TopicID = (get_magic_quotes_gpc()) ? $_GET['Topic'] : addslashes($_GET['Topic']); mysql_query("UPDATE topics SET topic_views=topic_views+1 WHERE topic_id=$TopicID"); It's so simple and short and can yet cause so such a headache. The point of it is to increment the amount of views of a topic with ONE. MSIE7 seemed to increment correctly, FireFox not. I'm going to test more browsers but really, there is absolutely no logical reason on why the field topic_views gets incremented with random numbers ranging from one to four with firefox. I've tested this code on an empty seperate page and it worked fine, but the origional code is just as isolated from the rest of the code as on the seperate page. Any ideas? I'd eat my shoes if this is really due to my own code.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.