1
AndreyRa
Re: Autologin for Xoops 2.0.x
  • 2003/6/25 7:59

  • AndreyRa

  • Just popping in

  • Posts: 17

  • Since: 2003/3/16


Quote:
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



2
AndreyRa
Re: Some useful hacks. Some new info.
  • 2003/6/24 23:29

  • AndreyRa

  • Just popping in

  • Posts: 17

  • Since: 2003/3/16


From this moment I stop the activity on creation of new hacks.
Because I need to reorganize all created updatings and to send them as diffs to developers.

If all this will go successfully I shall not place hacks here on forums more. All corrections will occur in new versions of Xoops. This way is more constructive.

PS. If only time has sufficed.



3
AndreyRa
Re: X2 NewBB: QuickReply Form
  • 2003/6/24 23:10

  • AndreyRa

  • Just popping in

  • Posts: 17

  • Since: 2003/3/16


Quote:

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?

It because I have taken advantage of tags [ code]. Now I know how many in them of bugs (correction is in the same forum) - I have replaced all tags [ code] with tags [ quote]. Now should work.

PS. Example of generating html from tag "code":
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 />


and tag "quote":
$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 />


As someone spoke, that at him Mozilla carries of lines is work. The bug whether or not - who knows...



4
AndreyRa
Re: is that bug ?
  • 2003/6/23 23:31

  • AndreyRa

  • Just popping in

  • Posts: 17

  • Since: 2003/3/16


No its a feature (c) ;)
Actually this it is made to prevent extra charge of the counter by simple updating of page.

Here is the hack:
file: \modules\newbb\viewtopic.php, serach for this lines
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);
}


and chage it for this: Quote:

//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);
//}


That's all!



5
AndreyRa
Re: time to say goodbye to newbb?
  • 2003/6/23 23:14

  • AndreyRa

  • Just popping in

  • Posts: 17

  • Since: 2003/3/16


Certainly if development XOOPS went faster - it would be possible to not see the given module.
There is only a question on translation of NewBB's database in the new module.

PS. If the question with licensing will not be solved, it will be necessary to develop NewBB up to phpBB's level. But all active users will be puts to themselves phpBB - is at all is not discussed.



6
AndreyRa
X2 Core: [code] tag's output correction
  • 2003/6/23 22:42

  • AndreyRa

  • Just popping in

  • Posts: 17

  • Since: 2003/3/16


This and other hacks available to download here: Some useful hacks

Tested with XOOPS 2.0.3

Subject: In tag [ code] there is a serious defect because of which to use this tag it is impossible.
For an example:
Try to copy and paste through buffer this text (in Notepad for example):
This is a first line.
And 
this is a second.
...


If you were not too lazy - you have understood that I had in view of. For lazy I explain: you in a notepad will not see any of line-breaks. The text will be in one line.

Second issue:
Example:
[url=xoops.org]I want to write a sample of my code...[/url]

I post where just [ url=xoops.org]I want to write a sample of my code...[ /url]. Some of my previous hacks comprised a part of an code of a Xoops. To avoid retranslation them in various XOOPS codes I had to go on some shifts.
This hack completely solve this problem. Not so it is beautiful as it might make itself Onokazu, but it is quite correct.

1. File \class\module.textsanitizer.php, this file will be one during all hack. line 151, line
$replacements[] = "'<div class="xoopsCode"><code><pre>'.stripslashes(wordwrap(MyTextSanitizer::htmlSpecialChars('\1'), 100)).'</pre></code></div>'";
replace for:
Quote:
//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


2. line 216, under function &nl2Br, add 2 new functions:
Quote:

//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", "/&nbsp;/i", "/\[/", "/\]/","/(\015\012)|(\015)|(\012)/"), array('&', '&nbsp;', "[" ,"]",'[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


3. line 319, after
if ($br != 0) {
            
$text =& $this->nl2Br($text);
        }
add:
Quote:

//Begin hack: [ code] tag content output correction
if ($xcode != 0) {
$text =& $this->nl2BrCode($text);
}
//End hack: [ code] tag content output correction


4. line 363, after
if ($br != 0) {
            
$text =& $this->nl2Br($text);
        }
add:
Quote:
//Begin hack: [ code] tag content output correction
if ($xcode != 0) {
$text =& $this->nl2BrCode($text);
}
//End hack: [ code] tag content output correction


5. line 426, after
$text $this->nl2Br($text);
add:
Quote:
//Begin hack: [ code] tag content output correction
if ($bbcode == 1) {
$text =& $this->nl2BrCode($text);
}
//End hack: [ code] tag content output correction


6. line 453, after
$text $this->nl2Br($text);
add:
Quote:

//Begin hack: [code] tag content output correction
if ($bbcode == 1) {
$text =& $this->nl2BrCode($text);
}
//End hack: [code] tag content output correction


that's all!



7
AndreyRa
Re: Autologin for Xoops 2.0.x
  • 2003/6/23 20:35

  • AndreyRa

  • Just popping in

  • Posts: 17

  • Since: 2003/3/16


Quote:
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...

Simply take last distribution kit of XOOPS and rewrite all files. Except one - mainfile.php.

PS. IMHO it is necessary to discuss all good and bad sides of hacks. With the purpose to press on developers of a XOOPS and to add good things inside of the distribution kit of a Xoops.



8
AndreyRa
Re: Autologin for Xoops 2.0.x
  • 2003/6/23 20:23

  • AndreyRa

  • Just popping in

  • Posts: 17

  • Since: 2003/3/16


Quote:
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

In my hack (I do not know as in the others) - users of a portal have a checkbox at an entrance (in login block).
If they will put this flag at an entrance - they will overlook about input any login or the password for 100 days.
Thus at each new visiting a site this term is prolonged automatically (for 100 days as I say).

The password is stored as the control sum. The name is stored as ID.

If somebody will prompt any unique variable automatically generated at installation of a XOOPS (like a PID in Apache) - that I shall make 100% secure system.

PS. A prolongation of length of sessions is not required any hack as far as I know. But sessions are necessary for another, and it is very bad idea about prolongation of session.



9
AndreyRa
Re: Autologin for Xoops 2.0.x
  • 2003/6/22 14:04

  • AndreyRa

  • Just popping in

  • Posts: 17

  • Since: 2003/3/16


This and other my hacks available to download here: Some useful hacks



10
AndreyRa
Re: Some useful hacks
  • 2003/6/22 11:58

  • AndreyRa

  • Just popping in

  • Posts: 17

  • Since: 2003/3/16


All these hacks available for download:
Autologin hack

All newbb hacks

[ code] tag hack

Readme inside.




TopTop
(1) 2 »



Login

Who's Online

248 user(s) are online (157 user(s) are browsing Support Forums)


Members: 0


Guests: 248


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits