phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Rebuild search MOD and CRON


 
Search this topic... | Search General Support... | Search Box
Register or Login to Post    Index » General Support  Previous TopicPrint TopicNext Topic
Author Message
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 628
Location: Spain


flag
PostPosted: Tue Jul 20, 2010 4:41 pm 
Post subject: Rebuild search MOD and CRON

Hello,

I'm not a spammer so don´t shoot me. icon_biggrin.gif

Anybody using this MOD that has been able to figure out how to run it let's say every 24 hours with a cron job?

_________________
phpBB2 will never die, I hope!
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 449
Location: Québec


flag
PostPosted: Tue Jul 20, 2010 6:44 pm 
Post subject: Re: Rebuild search MOD and CRON

I don't know about the MOD, but I had a quick look at the code. It doesn't work on a cron job? Any error?

Getting rid of the IN_PHPBB stuff, headers, template and the like and placing the code in a private folder could do it (I place my cron files in /etc). You'd be keeping lines 40 to 118 essentially, with some tweaks on the variables and includes before those first lines. And you'd need to add a connection to the database since there would be no includes to do it anymore. You'll need to change the filepath on line 42 and set/replace the POST or GET variable, from inside the code, to your desired value.

There may very well be some more bits to change, I just had a quick look at it without knowing exactly its purpose. Chances are you could work the other way around and just take the queries out of it and make your own file, leaving out everything that relies on admin input or displays something.
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 628
Location: Spain


flag
PostPosted: Tue Jul 20, 2010 6:57 pm 
Post subject: Re: Rebuild search MOD and CRON

I haven´t even tried to put it on a cron job, simply because I don´t know how to set a cron job for any file in the admin folder. icon_cry.gif

I know how to set up cron jobs, I've got quite a few running actually.

One of the problems I'm seeing is that there are quite a few different settings/options.

I appreciate your suggestions code-wise but I'm to much of a non-coder to be able to do anything with them. icon_wink.gif

The MOD in itself is very much like a drop-in thing, apart from two minor edits it's just a matter of placing files into place.

Just in case, I attach a copy of the MOD.

Greetings.



rebuild_search_2.4.0a.zip
 Description:

Download
 Filename:  rebuild_search_2.4.0a.zip
 Filesize:  59.61 KB
 Downloaded:  1483 Time(s)


_________________
phpBB2 will never die, I hope!
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 449
Location: Québec


flag
PostPosted: Wed Jul 21, 2010 3:12 am 
Post subject: Re: Rebuild search MOD and CRON

Oh, looks like I wasn't looking at the right MOD. This one seems a lot more complex and I unfortunately don't have enough time to look into this. Sorry icon_confused.gif
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 628
Location: Spain


flag
PostPosted: Wed Jul 21, 2010 3:20 am 
Post subject: Re: Rebuild search MOD and CRON

Don't worry, I appreciate your time anyway, and I guess I should have posted more info about the MOD in the first place.

Greetings. icon_wink.gif

_________________
phpBB2 will never die, I hope!
Back to top
Citrix
Board Member



Joined: 19 Feb 2012

Posts: 42



PostPosted: Thu Feb 23, 2012 10:40 am 
Post subject: Re: Rebuild search MOD and CRON

it's easier to add a cron using ssh if your host gives you access.
Put the file you want to execute in a folder somewhere. And add a small file in the folder /etc/cron.d to execute the task.
There are zillions of samples cron on the web.. Just google. You can almost automate any tasks for your site maintenance. I just learned all that the last 8 weeks, as my site was under heavy attacks and I was learning to defend myself. I can't believe I own a phpbb site all those years without setting up these small defensive mechanism. Google and learn. You'll love crons if you can write small programs.
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 628
Location: Spain


flag
PostPosted: Thu Feb 23, 2012 10:55 am 
Post subject: Re: Rebuild search MOD and CRON

Thanks for wiping of the dust! icon_smile.gif

I can set up cron jobs without a problem,

The thing is that I don´t know what to run, I'd have to add some parameters and I don´t know how to find out which ones to use to make the rebuild search with the proper settings.

_________________
phpBB2 will never die, I hope!
Back to top
Citrix
Board Member



Joined: 19 Feb 2012

Posts: 42



PostPosted: Thu Feb 23, 2012 11:15 am 
Post subject: Re: Rebuild search MOD and CRON

dogs and things wrote:
Thanks for wiping of the dust! icon_smile.gif
Exactly. Thanks.. I'd like this board to be busy with phpbb2 folks.
We have quite a few people still using phpbb2 and we should all find our way here to help each other.
Had I set up this site, I would not have called it phpbbrefugee. .. I think it should be called phpbb2 World Headquarter.
We are phpbb2. icon_smile.gif

As for the cron, I went a bit too fast. I have never installed that Mod. I don't know anything about it, so I spoke in general about crons. icon_smile.gif
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 449
Location: Québec


flag
PostPosted: Thu Feb 23, 2012 12:05 pm 
Post subject: Re: Rebuild search MOD and CRON

Had a quick look at the install file and the main file. I've never tried something like this, but maybe you can just specify GET parameters in your cron job's choice of script.
Example: '(...)admin_rebuild_search.php?mode=submit&start=0&clear_search=1...' (skipped the cron part since you know how to do it and I forget icon_smile.gif)

Basically you can look at the code and everywhere you see $HTTP_GET_VARS should be a parameter being checked in the URL. You can see above I specify mode=submit to launch the script (other options included refresh), start=0 to start at post_id 0 and clear_search=1 to clear the search tables. You can compare with the interface in the ACP to help you along the way.

One problem I can think of is admin privileges. Your cron probably won't be allowed to execute the code, and I'm not sure you can give it a fake admin session. But if you don't none of the includes are going to work and it's just going to get a redirect, I think...
Back to top
Citrix
Board Member



Joined: 19 Feb 2012

Posts: 42



PostPosted: Thu Feb 23, 2012 12:38 pm 
Post subject: Re: Rebuild search MOD and CRON

what does this Mod do?
Too lazy to dowload it and read all about it..
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 628
Location: Spain


flag
PostPosted: Thu Feb 23, 2012 2:00 pm 
Post subject: Re: Rebuild search MOD and CRON

Thanks for the suggestions Salvatos, I'll take a look.

Quote:
## This mod will index every post in your forum, rebuilding the search tables.
##
## This is useful when :
##
## - You have imported posts from another forum
## - You have lost/deleted/corrupted your phpbb search tables in one way or another
## - You want to transfer your db to another server (you can skip the copying of search tables
## which are usually quite a lot of MB and create them on the new server from scratch)
## - You have updated the "search_stopwords.txt" file (running the mod will remove these words from the search tables)
## - Users cannot find what they are searching for in your forum (although there could many other reasons for this)
##
## You can stop whenever you like and the next time you run it again, you'll have the option of
## continuing from where you left off.

_________________
phpBB2 will never die, I hope!
Back to top
Citrix
Board Member



Joined: 19 Feb 2012

Posts: 42



PostPosted: Thu Feb 23, 2012 2:07 pm 
Post subject: Re: Rebuild search MOD and CRON

thanks... that looks like a Must Have.
Back to top
Display posts from previous:   
Register or Login to Post    Index » General Support  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT - 4 Hours
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0849 seconds using 18 queries. (SQL 0.0110 Parse 0.0111 Other 0.0629)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo