Ace_Armstrong wrote:
I tried the edits listed here...got a big white screen and nothing else upon login.
If you had difficulties with manual updating a code - just try to download already modified files from here: Some Useful Hacks
Ace_Armstrong wrote:
I tried the edits listed here...got a big white screen and nothing else upon login.
bozzy wrote:
Your code gives me parse errors, something about expecting a , or ; on line 442 or something. And what's with those weird symbols?
sql = "SELECT forum_type, forum_name, forum_access, allow_html, allow_sig, posts_per_page,<br />hot_threshold, topics_per_page FROM ".$xoopsDB->prefix("bb_forums")." WHERE<br />forum_id = $forum";<br />
$sql = "SELECT forum_type, forum_name, forum_access, allow_html, allow_sig, posts_per_page, hot_threshold, topics_per_page FROM ".$xoopsDB->prefix("bb_forums")." WHERE forum_id = $forum";<br />
if ( empty($topic_lastread[$topic_id]) ) {
$sql = 'UPDATE '.$xoopsDB->prefix('bb_topics').' SET topic_views = topic_views + 1 WHERE topic_id ='. $topic_id;
$xoopsDB->queryF($sql);
}
//if ( empty($topic_lastread[$topic_id]) ) { //not needed
$sql = 'UPDATE '.$xoopsDB->prefix('bb_topics').' SET topic_views = topic_views + 1 WHERE topic_id ='. $topic_id;
$xoopsDB->queryF($sql);
//}
This is a first line.
And this is a second.
...
[url=xoops.org]I want to write a sample of my code...[/url]
$replacements[] = "'<div class="xoopsCode"><code><pre>'.stripslashes(wordwrap(MyTextSanitizer::htmlSpecialChars('\1'), 100)).'</pre></code></div>'";
//Begin hack: [ code] tag content output correction
$replacements[] = "'<div class=\"xoopsCode\"><code><pre>'.stripslashes(wordwrap(MyTextSanitizer::htmlSpecialCharsCode('\\1'), 100)).'</pre></code></div>'";
//End hack: [ code] tag content output correction
//Begin hack: [ code] tag content output correction
//copy of htmlSpecialChars function but adopted for [ code] content (thats may content other xoops's codes and required for unchanged linebreaks (for corrected html <pre> tag work))
//masking all \n and \r symbols from nl2Br function
//masking '[' and ']' symbols for comatibility with XOOPS codes which may be in a brought code.
function &htmlSpecialCharsCode($text)
{
return preg_replace(array("/&/i", "/ /i", "/\[/", "/\]/","/(\015\012)|(\015)|(\012)/"), array('&', ' ', "[" ,"]",'[xoops_code_nl]'), htmlspecialchars($text, ENT_QUOTES));
}
//copy of nl2Br function that's awaiting internal '[xoops_code_nl]' tags for reverting its to the originals \n.
function &nl2BrCode($text)
{
return preg_replace("/\[xoops_code_nl\]/","\n",$text);
}
//End hack: [ code] tag content output correction
if ($br != 0) {
$text =& $this->nl2Br($text);
}
//Begin hack: [ code] tag content output correction
if ($xcode != 0) {
$text =& $this->nl2BrCode($text);
}
//End hack: [ code] tag content output correction
if ($br != 0) {
$text =& $this->nl2Br($text);
}
//Begin hack: [ code] tag content output correction
if ($xcode != 0) {
$text =& $this->nl2BrCode($text);
}
//End hack: [ code] tag content output correction
$text = $this->nl2Br($text);
//Begin hack: [ code] tag content output correction
if ($bbcode == 1) {
$text =& $this->nl2BrCode($text);
}
//End hack: [ code] tag content output correction
$text = $this->nl2Br($text);
//Begin hack: [code] tag content output correction
if ($bbcode == 1) {
$text =& $this->nl2BrCode($text);
}
//End hack: [code] tag content output correction
patagon wrote:
also, does one have to "uninstall' one of the hacks before "installing" the other? I have been trying so many things to get this done that I dont even know how many files I modified...
patagon wrote:
Hi:
I wonder if anyone can explain (in a simple, for non programmers way) the difference between these hacks. I currently use one of them (I believe its jan's) and it seems to work, users stay logged for the time that I specify the custom session to last. I have setted that in minutes to a day, I would like to set it longer (like some sites I visit where I'm never logged out) but I read someplace that it wasnt a good idea, because of performance issues with the server.
What i wonder is if these new hack by andrey will let me set it so that users never log out (unless they want to). I guess I am missing something here, but thats why a good explanation would help