Welcome, Guest. Please Login or Register.
November 27, 2024, 06:43:38 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Completed mods  |  [Done 1.5.2] SearchNew Mod v.09 « previous next »
Pages: 1 ... 6 7 [8] 9 Reply Ignore Print
Author Topic: [Done 1.5.2] SearchNew Mod v.09  (Read 26085 times)
Webby
Beta Tester
YaBB God
*****
Posts: 829


Some mistakes are too funny to make only once.

ICQ - 9814812webby@salesplaza.nl WWW
Re:[Done 1.4.1] SearchNew Mod v.08
« Reply #105 on: March 15, 2003, 09:49:41 AM »
Reply with quote

On B44 I have..............so it must be ok for B45..........
Logged

Webby of salesplaza.nl
The YaBBSE buttongenerator : Click HERE !
Karsten
Noobie
*
Posts: 10


nope

Re:[Done 1.4.1] SearchNew Mod v.08
« Reply #106 on: March 15, 2003, 05:07:00 PM »
Reply with quote

Quote from: Webby on March 15, 2003, 09:49:41 AM
On B44 I have..............so it must be ok for B45..........

great, where can i get it?
Logged
Webby
Beta Tester
YaBB God
*****
Posts: 829


Some mistakes are too funny to make only once.

ICQ - 9814812webby@salesplaza.nl WWW
Re:[Done 1.4.1] SearchNew Mod v.08
« Reply #107 on: March 16, 2003, 12:19:21 AM »
Reply with quote

<file>
index.php
</file>

<search>
     'search2' => array("$sourcedir/Search.php", 'plushSearch2'),
</search>

<add>
     'searchnew' => array("$sourcedir/SearchNew.php", 'SearchNew'),
     'searchnew_markallread' => array("$sourcedir/SearchNew.php", 'SearchNew_MarkAllRead'),
     'searchnew_marktopicread' => array("$sourcedir/SearchNew.php", 'SearchNew_MarkTopicRead'),
     'searchnew_markboardread' => array("$sourcedir/SearchNew.php", 'SearchNew_MarkBoardRead'),
     'searchnew_markcategoryread' => array("$sourcedir/SearchNew.php", 'SearchNew_MarkCategoryRead'),
     'searchnew_cleanup' => array("$sourcedir/SearchNew.php", 'SearchNew_Cleanup'),
</add>


<file>
dutch.lng
</file>

<search>
  $img['search'] = '<img src="' . $imagesdir . '/search.gif" alt="' . $txt[182] . '" border="0" />';
</search>

<add>
  $img['searchnew'] = '<img src="' . $imagesdir . '/searchnew.gif" alt="' . $txt[searchnew1] . '" border="0" />';</add>

<search>
$txt['yse217'] = 'Live vanaf www.yabb.info...';
</search>

<add>
$txt['searchnew1'] = 'Zoek naar nieuwe berichten';
$txt['searchnew2'] = 'Markeer alle berichten als gelezen';
$txt['searchnew3'] = 'Markeer dit bericht als gelezen';
$txt['searchnew4'] = 'Limiet van';
$txt['searchnew5'] = 'bereikt.  Niet alle nieuwe berichten worden getoond.';
$txt['searchnew6'] = 'Negeer deze topic voor de komende 7 dagen';
</add>

<search>
  $img['search'] = $txt[182];
</search>

<add>
  $img['searchnew'] = $txt[searchnew1];
</add>

<file>
Sources/Subs.php
</file>

<search>
  if($username == "Guest") { $yymenu .= $menusep."<a href=\"$cgi;action=login\">$img[login]</a>$menusep<a href=\"$cgi;action=register\">$img[register]</a>";
  } else {
</search>


<add>
     $yymenu .= "$menusep<a href=\"$cgi;action=searchnew\">$img[searchnew]</a>";
</add>


Then, put the attached SearchNew.php in the Sources directory, and that should be all !
Logged

Webby of salesplaza.nl
The YaBBSE buttongenerator : Click HERE !
Karsten
Noobie
*
Posts: 10


nope

Re:[Done 1.4.1] SearchNew Mod v.08
« Reply #108 on: March 16, 2003, 06:57:37 AM »
Reply with quote

great :) thx
it works  :D :D
Logged
Forge
Noobie
*
Posts: 23


WWW
Re:[Done 1.4.1] SearchNew Mod v.08
« Reply #109 on: March 28, 2003, 04:16:21 PM »
Reply with quote

I found a problem with the searchnew_cleanup function in my mod.  Basically this function is used to cleanup the log_topics table (which can get very full if you have a lot of users & topics).  It is only really important for people that are really concerned about performance.

Since the logtime on boards trumps the logtime on topics, we can set the logtime on the board and delete all the topic logtimes.  This results in 1 record for each user for each board instead of 1 record for each user for each topic.  The problem I ran into was that my code didn't account for some users that may never have marked a board read before.  Therefore after running the cleanup function, some users would see all the topics on some boards including all the old topics.

In any case, here's the code.  Please edit the Sources/SearchNew.php file and replace the SearchNew_Cleanup function with this one:

//-----------------------------------------
//  SearchNew_Cleanup
//
//  Purpose:  removes old history from
//   all users to help speed up the
//   search functions.
//-----------------------------------------
function SearchNew_Cleanup (){
   global $settings,$sourcedir,$db_prefix;
   
   $cleantime=time() - 259200;  //time now minus 30 days

   // We need to make sure that each user has a mark read record for each board since we're
   // counting on their board mark read entry to trump the topic mark read entries.
   $result2 = mysql_query("SELECT memberName from {$db_prefix}members");
   while (list($memberName) = mysql_fetch_row($result2)) {   
      // For each user, loop through the boards
      $result = mysql_query("SELECT c.ID_CAT,b.ID_BOARD ".
         "FROM {$db_prefix}categories as c,{$db_prefix}boards as b");
      while (list($ID_CAT,$ID_BOARD) = mysql_fetch_row($result)){
         $request = mysql_query("SELECT logTime ".
            "FROM {$db_prefix}log_mark_read ".
            "WHERE (memberName='$memberName' AND ID_BOARD=$ID_BOARD) LIMIT 1");
         if (mysql_num_rows($request)==0) {
            // entry for this user doesnt exist so create it.
            // Note this will create entries for users even in tables they
            // don't have permissions to.  This is not a security problem,
            // but you should know it exists in case you ever browse your
            // tables manually.
            $request = mysql_query("INSERT INTO {$db_prefix}log_mark_read ".
               "(logTime,memberName,ID_BOARD) ".
               "VALUES ($cleantime,'$memberName',$ID_BOARD)");
         }
      }
   }
   // Now update all entries in log_mark_read that are less than $cleantime
   $request = mysql_query("UPDATE {$db_prefix}log_mark_read SET logTime=$cleantime ".
      "WHERE (logTime < $cleantime)");   
   
   //Delete all log entries from log_topics prior to this logtime
   //this is done to conserve space in the database since the entry
   //in log_mark_read trumps the entry here.
   $request = mysql_query("DELETE FROM {$db_prefix}log_topics ".
      "WHERE (logTime < $cleantime)");
   // Redirect to BoardIndex when we're done.
   include_once "$sourcedir/BoardIndex.php"; BoardIndex();
   obExit();
   
}



Once this change is made, using the URL:
/index.php?action=searchnew_cleanup will mark all topics older than 30 days old as read for all users.

I'll include this change when I release the next version of the mod for 1.5.
« Last Edit: March 28, 2003, 04:19:17 PM by Forge » Logged
Anguz
YaBB God
*****
Posts: 641


llama me?!

WWW
Re:[Done 1.4.1] SearchNew Mod v.08
« Reply #110 on: April 02, 2003, 01:46:50 AM »
Reply with quote

Webby, what would be the translation to english of that code you put in your last reply?  ;D
Logged

My Mods: Avatar & Sig Size Control, No Show Msg Subject, Msg URL Composer, Built-in Avatar Rand, Built-in Sig Rand, Remove New-lines Excess, Show All Stars, Search Bar, Smart URLs
Webby
Beta Tester
YaBB God
*****
Posts: 829


Some mistakes are too funny to make only once.

ICQ - 9814812webby@salesplaza.nl WWW
Re:[Done 1.4.1] SearchNew Mod v.08
« Reply #111 on: April 02, 2003, 03:59:28 AM »
Reply with quote

$txt['searchnew1'] = "Search for New Messages";
$txt['searchnew2'] = "Mark ALL topics read (not including new posts since this search)";
$txt['searchnew3'] = "Mark this item as read";
$txt['searchnew4'] = "Limit of";
$txt['searchnew5'] = "reached.  Not all new messages have been displayed.";
$txt['searchnew6'] = "Ignore this topic for 7 days";


By-the-way, I get an error when I use the code (topic above) to "cleanup" the database :

2: Supplied argument is not a valid MySQL result resource
(/home/sites/salesplaza.nl/www/forum/Sources/SearchNew.php ln 498)

Logged

Webby of salesplaza.nl
The YaBBSE buttongenerator : Click HERE !
Webby
Beta Tester
YaBB God
*****
Posts: 829


Some mistakes are too funny to make only once.

ICQ - 9814812webby@salesplaza.nl WWW
Re:[Done 1.4.1] SearchNew Mod v.08
« Reply #112 on: April 02, 2003, 04:04:44 AM »
Reply with quote

I hope this is ok :


//-----------------------------------------
//  SearchNew_Cleanup
//
//  Purpose:  removes old history from
//  all users to help speed up the
//  search functions.
//-----------------------------------------
function SearchNew_Cleanup (){
  global $settings,$sourcedir,$db_prefix;
 
  $cleantime=time() - 259200;  //time now minus 30 days

  // We need to make sure that each user has a mark read record for each board since we're
  // counting on their board mark read entry to trump the topic mark read entries.
  $result2 = mysql_query("SELECT ID_MEMBER from {$db_prefix}members");
  while (list($ID_MEMBER) = mysql_fetch_row($result2)) {  
     // For each user, loop through the boards
     $result = mysql_query("SELECT c.ID_CAT,b.ID_BOARD ".
        "FROM {$db_prefix}categories as c,{$db_prefix}boards as b");
     while (list($ID_CAT,$ID_BOARD) = mysql_fetch_row($result)){
        $request = mysql_query("SELECT logTime ".
           "FROM {$db_prefix}log_mark_read ".
           "WHERE (ID_MEMBER='$ID_MEMBER' AND ID_BOARD=$ID_BOARD) LIMIT 1");
        if (mysql_num_rows($request)==0) {
           // entry for this user doesnt exist so create it.
           // Note this will create entries for users even in tables they
           // don't have permissions to.  This is not a security problem,
           // but you should know it exists in case you ever browse your
           // tables manually.
           $request = mysql_query("INSERT INTO {$db_prefix}log_mark_read ".
              "(logTime,ID_MEMBER,ID_BOARD) ".
              "VALUES ($cleantime,'$ID_MEMBER',$ID_BOARD)");
        }
     }
  }
  // Now update all entries in log_mark_read that are less than $cleantime
  $request = mysql_query("UPDATE {$db_prefix}log_mark_read SET logTime=$cleantime ".
     "WHERE (logTime < $cleantime)");  
 
  //Delete all log entries from log_topics prior to this logtime
  //this is done to conserve space in the database since the entry
  //in log_mark_read trumps the entry here.
  $request = mysql_query("DELETE FROM {$db_prefix}log_topics ".
     "WHERE (logTime < $cleantime)");
  // Redirect to BoardIndex when we're done.
  include_once "$sourcedir/BoardIndex.php"; BoardIndex();
  obExit();
 
}
Logged

Webby of salesplaza.nl
The YaBBSE buttongenerator : Click HERE !
Surfy
Sr. Member
****
Posts: 458


I'm a llama!

Re:[Done 1.4.1] SearchNew Mod v.08
« Reply #113 on: April 15, 2003, 01:24:26 PM »
Reply with quote

work this mod for 1.5.1?

Surfy
Logged
Webby
Beta Tester
YaBB God
*****
Posts: 829


Some mistakes are too funny to make only once.

ICQ - 9814812webby@salesplaza.nl WWW
Re:[Done 1.4.1] SearchNew Mod v.08
« Reply #114 on: April 17, 2003, 08:36:44 PM »
Reply with quote

Yes, it works in v1.5.1 Final (in use at yabb.nl ;))
Logged

Webby of salesplaza.nl
The YaBBSE buttongenerator : Click HERE !
Surfy
Sr. Member
****
Posts: 458


I'm a llama!

Re:[Done 1.4.1] SearchNew Mod v.08
« Reply #115 on: April 18, 2003, 02:51:37 PM »
Reply with quote


thanks!

Where can i dwonload the Package for YabbSe 1.5.1 ?

If possible the Boardmod one..

Surfy
Logged
Forge
Noobie
*
Posts: 23


WWW
Re:[Done 1.5.2] SearchNew Mod v.09
« Reply #116 on: April 29, 2003, 02:52:20 AM »
Reply with quote

FYI, I have updated my mod for version 1.5.2.

The YABBPak is available on my server (directions in the first post in this thread).

A zip version is available here:
http://www.flakshack.com/yabbse/attachments/searchnew_.09_for_yabbse_1.5.2.zip

See the README for installation instructions for the zip version.


No new features in this version, just the fixes to stay compatible with 1.5x's change in the log tables (replacing the membername field with the ID_MEMBER field).  Good change, BTW!

As usual, please let me know if you have any problems.
Logged
Horseman
YaBB God
*****
Posts: 784


'MAS VALE CABALLO QUE CAUDAL!'

ICQ - 44729151 WWW
Re:[Done 1.5.2] SearchNew Mod v.09
« Reply #117 on: May 30, 2003, 09:09:37 PM »
Reply with quote

a small bug?   ???

the yabb code cannot be seen in search new window.

[color=Red]Mann o Mann, da rollt ja echt...
or
Also ich würde sagen im [shadow=red,left,300]März[/shadow] siehts bei...

or
[quote author=Bill Ramsey link=board=3;threadid=11;start=0#msg56 date...
Logged
taznumber1
Noobie
*
Posts: 13


I'm a llama!

Re:[Done 1.5.2] SearchNew Mod v.09
« Reply #118 on: May 31, 2003, 12:31:33 AM »
Reply with quote

Do you not have that yabbpak anymore for 1.5.2 I do not see it listed anymore
Logged
Mr T
Noobie
*
Posts: 1


I'm a llama!

Re:[Done 1.5.2] SearchNew Mod v.09
« Reply #119 on: June 12, 2003, 07:33:06 AM »
Reply with quote

Will there be a update to version 1.5.3 available???
Logged
Pages: 1 ... 6 7 [8] 9 Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  [Done 1.5.2] SearchNew Mod v.09 « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.030 seconds with 20 queries.