Go Back   PHP Link Directory Forum > PHP Link Directory (phpLD) > Mods and contribution Discussion

Mods and contribution Discussion This forum is only for discussion of modding phpLD. For specific mod releases, please see the appropriate forum.

Closed Thread
 
Thread Tools Display Modes
Old 12-18-2005   #1
Ap0s7le
 
Join Date: Jun 2005
Location: The world
Posts: 816
Send a message via ICQ to Ap0s7le Send a message via AIM to Ap0s7le Send a message via MSN to Ap0s7le Send a message via Yahoo to Ap0s7le Send a message via Skype™ to Ap0s7le
Default Track Internal Searches

Here it is, as talked about in this thread.
{deleted}

Please consider sending a donation to me for my time, PayPal details can be given out in PM upon request.

Regards

-Casey
Attached Files
File Type: zip internal-search-tracker.zip (3.0 KB, 263 views)
__________________
Casey Wilson / Ap0s7le
Freelance Programmer
http://www.ap0s7le.com
Need help with PHPLD? PM me

Last edited by David; 06-13-2008 at 08:33 PM.
Ap0s7le is offline  
Old 12-18-2005   #2
thompson
Supporter
 
Join Date: Oct 2005
Posts: 548
Default

it works very good.

what must i change to give it to my users ? (external search)
__________________
many thanks.

thompson.
thompson is offline  
Old 12-18-2005   #3
Ap0s7le
 
Join Date: Jun 2005
Location: The world
Posts: 816
Send a message via ICQ to Ap0s7le Send a message via AIM to Ap0s7le Send a message via MSN to Ap0s7le Send a message via Yahoo to Ap0s7le Send a message via Skype™ to Ap0s7le
Default

Give it to your users?

What do you mean?

The actual results, like you see in the admin?

-Casey
__________________
Casey Wilson / Ap0s7le
Freelance Programmer
http://www.ap0s7le.com
Need help with PHPLD? PM me
Ap0s7le is offline  
Old 12-18-2005   #4
thompson
Supporter
 
Join Date: Oct 2005
Posts: 548
Default

i will give my users a site.

on this site there are the search words of the last searches.

example:

{deleted}
__________________
many thanks.

thompson.

Last edited by David; 06-13-2008 at 08:33 PM.
thompson is offline  
Old 12-18-2005   #5
Ap0s7le
 
Join Date: Jun 2005
Location: The world
Posts: 816
Send a message via ICQ to Ap0s7le Send a message via AIM to Ap0s7le Send a message via MSN to Ap0s7le Send a message via Yahoo to Ap0s7le Send a message via Skype™ to Ap0s7le
Default

Sure that is fully possible.

Just query the new table, and pull the results from there and sort as you wish.

If you can't do that, then I can help.

I've got to go, church get together.

later!

-Casey
__________________
Casey Wilson / Ap0s7le
Freelance Programmer
http://www.ap0s7le.com
Need help with PHPLD? PM me
Ap0s7le is offline  
Old 01-05-2006   #6
thompson
Supporter
 
Join Date: Oct 2005
Posts: 548
Default

hi casey,

i have it on a separate page and i works good. what i need is a link to the searchresults. (not the problem with index.php?p=searchresult)

searchresult should be a html page.

what i mean: i need a htaccess rewrite from index.php?.... to searchresult.html.

do you know a answer ? thanks for helping.
__________________
many thanks.

thompson.
thompson is offline  
Old 02-25-2006   #7
igotdreams
 
Join Date: Feb 2006
Location: Orlando, Florida
Posts: 12
Default

Okay you were killing me with that blank m_statistics.gif.

I thought the code was broken and was looking all over for it, until I thought maybe I uploaded a corrupted file and when I opened it found it was the same color as the background.

If anyone needs a graphic, here is one;

igotdreams is offline  
Old 02-25-2006   #8
Neticus
Supporter
 
Neticus's Avatar
 
Join Date: Dec 2005
Posts: 487
Default

Quote:
Originally Posted by igotdreams
Okay you were killing me with that blank m_statistics.gif.
LOL same thing happened to me. :lol:

Thanks for the gif had been meaning to sort a graphic for that.

Net.
Neticus is offline  
Old 05-17-2006   #9
droolingmnky
Supporter
 
droolingmnky's Avatar
 
Join Date: Jan 2006
Location: Michigan
Posts: 199
Send a message via AIM to droolingmnky Send a message via Skype™ to droolingmnky
Default

3.04 friendly

You still need the archive of the files in the first post.
Do not follow the search-tracker.mod file if your using 3.04 follow this.

There were no major changes I just want credit for taking the time to change one variable, and updating the instructions a little.

Code:
##############################################################

## MOD Title: Internal Search Tracker

## MOD Author: Casey Wilson < at@ap0s7le.com > http://www.ap0s7le.com

## MOD Description: Enables the ability to track internal searches.

## MOD Version: 1.0.0

## 

## Installation Level: Intermediate

## Installation Time: 15 Minutes 

## Files To Edit: 

##          /admin/init.php

##          /include/functions.php

##          /include/tables.php

##          /index.php

##

## Included Files:

##          statistics.php

##          statistics.tpl

##          m_statistics.gif

##

##############################################################

## Author Notes: 

##        This MOD has been updated to 3.04.

##        YMMV, if you have any issues feel free to email me.

##        Paid services are also available.

##############################################################

## MOD History:

##
##    2006-5-17 - updated for 3.04
## 

##   2005-12-17 - Version 1.0.0

## 

##      - Initial release.

## 

##############################################################

## Before Adding This MOD To Your Directory, You Should Back Up All Files Related To This MOD 

##############################################################

##

#

#-----[ SQL ]------------------------------------------

# Where 'PLD_' is your table prefix 

CREATE TABLE `PLD_SEARCHES` (

  `ID` int(11) NOT NULL auto_increment,

  `QUERY` varchar(255) NOT NULL default '',

  `NUM` int(11) NOT NULL default '0',

  `TIME` timestamp(14) NOT NULL,

  PRIMARY KEY  (`ID`)

) TYPE=MyISAM;

#

#-----[ COPY ]------------------------------------------

#

copy statistics.php to /admin/statistics.php

copy statistics.tpl to /templates/admin/statistics.tpl

copy m_statistics.gif to /admin/images/m_statistics.gif

#

#-----[ OPEN ]------------------------------------------

#

/admin/init.php

#

#-----[ FIND ]------------------------------------------

#

                        ),

                        'message' => array('label' => _L('Edit Email Templates'), 'url' => 'email_message.php'),

                        'payment' => array('label' => _L('Payments'), 'url' => 'conf_payment.php', 'disabled' => PAY_ENABLE!=='1'),

                        'profile' => _L('Profile'),

                        'users' => _L('Edit Users'),

                        )

                    ),

#

#-----[ AFTER, ADD ]------------------------------------------

#

        'statistics' => _L('Statistics'),

#

#-----[ OPEN ]------------------------------------------

#

include/functions.php

#

#-----[ FIND ]------------------------------------------

#

?>

#

#-----[ BEFORE, ADD ]------------------------------------------

#

function track_searches($db, $query)

{

    global $tables;



    $sql = "SELECT COUNT(*) FROM {$tables['searches']['name']} WHERE QUERY = " . $db->qstr($query) . "";

    if ($db->GetOne($sql) > 0)

    {

        $db->Execute("UPDATE {$tables['searches']['name']} SET NUM=NUM+1 WHERE QUERY = " . $db->qstr($query) . "");

    }

    else

    {

        $db->Execute("INSERT INTO {$tables['searches']['name']} VALUES(NULL, " .$db->qstr($query) . ", 1, NULL)") or die (mysql_error());

    }

}

#

#-----[ OPEN ]------------------------------------------

#

/include/tables.php

#

#-----[ FIND ]------------------------------------------

#

 $tables['user_permission'] = array(

     'name' => TABLE_PREFIX.'USER_PERMISSION',

      'fields' => array(

         'ID' => 'I KEY AUTO',

         'USER_ID' => 'I NOTNULL',

         'CATEGORY_ID' => 'I NOTNULL',

     )

 );

#

#-----[ AFTER, ADD ]------------------------------------------

#

 $tables['searches'] = array(

     'name' => TABLE_PREFIX.'SEARCHES',

      'fields' => array(

         'ID' => 'I KEY AUTO',

         'QUERY' => 'C(255) NOTNULL',

        'NUM' => 'I NOTNULL',

         'TIME' => 'T',

     )

 );

#

#-----[ OPEN ]------------------------------------------

#

/index.php

#

#-----[ FIND ]------------------------------------------

#

elseif (isset ($_REQUEST['search'])) // Search results
{
   require_once 'search.php';
#

#-----[ AFTER, ADD ]------------------------------------------

#

track_searches($db, $_REQUEST['search']);

#

#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------

#

# EoM
__________________
droolingmonkey.com

Last edited by droolingmnky; 05-17-2006 at 09:20 AM.
droolingmnky is offline  
Old 07-10-2006   #10
gustotelmy
Supporter
 
Join Date: Nov 2005
Posts: 182
Default

Thanks for this although i get

Warning: Smarty error: unable to read resource: "admin/statistics.tpl" in /home/user/public_html/libs/smarty/Smarty.class.php on line 1095

in versison 3.0.5 anything I did wrong? does this still work with 3.0.5?
gustotelmy is offline  
Old 07-10-2006   #11
gustotelmy
Supporter
 
Join Date: Nov 2005
Posts: 182
Default

OK fixed though i should get some credit! :P


Upload statistics.tpl into your /admin/ directory

change the following in statistics.php

Find:

$tpl->assign('searched', $searched);
$tpl->assign('requested', $requested);

Then change the NEXT line to:

$content = $tpl->fetch('/home/user/public_html/*/admin/statistics.tpl');

(where user is your username and * is your phpld directory location)

worked for me in 3.0.5!

by the way, what happened to Apostle??
gustotelmy is offline  
Old 07-15-2006   #12
dcristo
Supporter
 
Join Date: Apr 2006
Posts: 89
Default

Quote:
Originally Posted by thompson
hi casey,

i have it on a separate page and i works good. what i need is a link to the searchresults. (not the problem with index.php?p=searchresult)

searchresult should be a html page.

what i mean: i need a htaccess rewrite from index.php?.... to searchresult.html.

do you know a answer ? thanks for helping.
Do you mind sharing how you got the internal stats on a separate page?
dcristo is offline  
Old 07-15-2006   #13
dcristo
Supporter
 
Join Date: Apr 2006
Posts: 89
Default

Quote:
Originally Posted by droolingmnky
3.04 friendly

You still need the archive of the files in the first post.
Do not follow the search-tracker.mod file if your using 3.04 follow this.

There were no major changes I just want credit for taking the time to change one variable, and updating the instructions a little.

Code:
##############################################################

## MOD Title: Internal Search Tracker

## MOD Author: Casey Wilson < at@ap0s7le.com > http://www.ap0s7le.com

## MOD Description: Enables the ability to track internal searches.

## MOD Version: 1.0.0

## 

## Installation Level: Intermediate

## Installation Time: 15 Minutes 

## Files To Edit: 

##          /admin/init.php

##          /include/functions.php

##          /include/tables.php

##          /index.php

##

## Included Files:

##          statistics.php

##          statistics.tpl

##          m_statistics.gif

##

##############################################################

## Author Notes: 

##        This MOD has been updated to 3.04.

##        YMMV, if you have any issues feel free to email me.

##        Paid services are also available.

##############################################################

## MOD History:

##
##    2006-5-17 - updated for 3.04
## 

##   2005-12-17 - Version 1.0.0

## 

##      - Initial release.

## 

##############################################################

## Before Adding This MOD To Your Directory, You Should Back Up All Files Related To This MOD 

##############################################################

##

#

#-----[ SQL ]------------------------------------------

# Where 'PLD_' is your table prefix 

CREATE TABLE `PLD_SEARCHES` (

  `ID` int(11) NOT NULL auto_increment,

  `QUERY` varchar(255) NOT NULL default '',

  `NUM` int(11) NOT NULL default '0',

  `TIME` timestamp(14) NOT NULL,

  PRIMARY KEY  (`ID`)

) TYPE=MyISAM;

#

#-----[ COPY ]------------------------------------------

#

copy statistics.php to /admin/statistics.php

copy statistics.tpl to /templates/admin/statistics.tpl

copy m_statistics.gif to /admin/images/m_statistics.gif

#

#-----[ OPEN ]------------------------------------------

#

/admin/init.php

#

#-----[ FIND ]------------------------------------------

#

                        ),

                        'message' => array('label' => _L('Edit Email Templates'), 'url' => 'email_message.php'),

                        'payment' => array('label' => _L('Payments'), 'url' => 'conf_payment.php', 'disabled' => PAY_ENABLE!=='1'),

                        'profile' => _L('Profile'),

                        'users' => _L('Edit Users'),

                        )

                    ),

#

#-----[ AFTER, ADD ]------------------------------------------

#

        'statistics' => _L('Statistics'),

#

#-----[ OPEN ]------------------------------------------

#

include/functions.php

#

#-----[ FIND ]------------------------------------------

#

?>

#

#-----[ BEFORE, ADD ]------------------------------------------

#

function track_searches($db, $query)

{

    global $tables;



    $sql = "SELECT COUNT(*) FROM {$tables['searches']['name']} WHERE QUERY = " . $db->qstr($query) . "";

    if ($db->GetOne($sql) > 0)

    {

        $db->Execute("UPDATE {$tables['searches']['name']} SET NUM=NUM+1 WHERE QUERY = " . $db->qstr($query) . "");

    }

    else

    {

        $db->Execute("INSERT INTO {$tables['searches']['name']} VALUES(NULL, " .$db->qstr($query) . ", 1, NULL)") or die (mysql_error());

    }

}

#

#-----[ OPEN ]------------------------------------------

#

/include/tables.php

#

#-----[ FIND ]------------------------------------------

#

 $tables['user_permission'] = array(

     'name' => TABLE_PREFIX.'USER_PERMISSION',

      'fields' => array(

         'ID' => 'I KEY AUTO',

         'USER_ID' => 'I NOTNULL',

         'CATEGORY_ID' => 'I NOTNULL',

     )

 );

#

#-----[ AFTER, ADD ]------------------------------------------

#

 $tables['searches'] = array(

     'name' => TABLE_PREFIX.'SEARCHES',

      'fields' => array(

         'ID' => 'I KEY AUTO',

         'QUERY' => 'C(255) NOTNULL',

        'NUM' => 'I NOTNULL',

         'TIME' => 'T',

     )

 );

#

#-----[ OPEN ]------------------------------------------

#

/index.php

#

#-----[ FIND ]------------------------------------------

#

elseif (isset ($_REQUEST['search'])) // Search results
{
   require_once 'search.php';
#

#-----[ AFTER, ADD ]------------------------------------------

#

track_searches($db, $_REQUEST['search']);

#

#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------

#

# EoM
Cheers droolingmonkey for the modded instructions for 3.04
dcristo is offline  
Old 07-16-2006   #14
Momo
 
Join Date: May 2006
Posts: 29
Default

Thank you very much for this mod, I have implemented it in my directory and also made some changes so the last 10 searches appears on my front page for the users' benefit. You can see it at http://ipage.info/
Momo is offline  
Old 07-16-2006   #15
dcristo
Supporter
 
Join Date: Apr 2006
Posts: 89
Default

Quote:
Originally Posted by Momo
Thank you very much for this mod, I have implemented it in my directory and also made some changes so the last 10 searches appears on my front page for the users' benefit. You can see it at http://ipage.info/
Looking cool man. Is this something your gonna make available as a mod?
dcristo is offline  
Old 07-16-2006   #16
regg
Supporter
Moderator
 
Join Date: Apr 2006
Posts: 1,721
Question

How can i get this mod for version 3.05????
__________________
Jetzt Neu: Immer aktuelle Gutscheine:
http://www.gutscheinbase.de
---
phpLD Services German
---
regg is offline  
Old 07-16-2006   #17
droolingmnky
Supporter
 
droolingmnky's Avatar
 
Join Date: Jan 2006
Location: Michigan
Posts: 199
Send a message via AIM to droolingmnky Send a message via Skype™ to droolingmnky
Default

The version I posted above is working for 3.05
__________________
droolingmonkey.com
droolingmnky is offline  
Old 07-16-2006   #18
regg
Supporter
Moderator
 
Join Date: Apr 2006
Posts: 1,721
Default

ah ok. is not working for me !
__________________
Jetzt Neu: Immer aktuelle Gutscheine:
http://www.gutscheinbase.de
---
phpLD Services German
---
regg is offline  
Old 07-17-2006   #19
droolingmnky
Supporter
 
droolingmnky's Avatar
 
Join Date: Jan 2006
Location: Michigan
Posts: 199
Send a message via AIM to droolingmnky Send a message via Skype™ to droolingmnky
Default

What does it say or not say?

Did you follow the instructions I posted or not?
__________________
droolingmonkey.com
droolingmnky is offline  
Old 12-20-2006   #20
Vinci
Supporter
 
Join Date: Dec 2006
Posts: 12
Question

Hello,
dcristo can you show the code you use to show stats of top searched on yours directory page, I tried to do it myself but with no good results, thx for all help

mayby anyone else know how to do it and pase the code here
Vinci is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:58 PM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.