This messed up page numbering system is getting to me, so try this. And I'm terrible at regex, so there might be an error in here somewhere.
Add a new text field to wherever you store the topics, and concatenate the following string onto it whenever someone views it.
::$USERID-$LASTPOSTID::
Preg match to see if their data already exists in the string. If so;
$text = preg_replace("/::".$USERID."\-(.*?)::/is", "::".$USERID."-".$LASTPOSTID."::", $text);
When the page loads and you're ready to add the hash onto the URL, pull the data out of the string. There's probably an easier way to do this, but oh well. :L
$urlHash = explode(" ", str_replace("::", "", str_replace("::::", " ", $lastView['lastView'])));
foreach($urlHash as $urlHash2){
if(preg_match("/".$USERID."\-(.*?)/is", $urlHash2)){
$urlHash3 = explode("-", $urlHash2);
echo "#".$urlHash3[1];
};
};
And look through this. SC has a bad habit of stripping characters such as backslash. My code will probably come out messed up.
« Last edited by Forgoten_Scars on Mar 6th 2013 »