News:

Wondering if this will always be free?  See why free is better.

Main Menu

Converting a phpBB bot for SMF

Started by Old Lynx, July 09, 2008, 06:50:06 AM

Previous topic - Next topic

DomDom Skye


DareDevil1990

any way to make this bot checkk each and evry thread of the forum regardless wheather it has been viewed or not :)

Lanthan

Hmmm.. not so easy... but I understand what you want.
It's a precheck, or initialisation whats needed.

So give this little script a try:
precheckallrslinks.php

I have attached it to this post, you have to copy it to the boarddir where the cronrschecker script is located. Then call it from your browser. It should scan all your messages on the forum and put the unchecked ones into rs_checker.

Rhine

Quote from: Lanthan on September 16, 2008, 11:48:51 AM
Quote from: Rhine on September 16, 2008, 11:23:14 AM
Yes it is.
In which one? If they are in the rs_checker, then the script does not run.
The script copies all checked links from the rs_checker to the rs_links table.

Its links in rs_links and not in rs_checker, the bot does bin, but it doesnt edit a message in a topic "0% of the links are dead"

Lanthan

#84
Do you see the "0% of the links are dead" at the bottom of the post?
If yes, so all Links are valid, which you can see in rs_links in the field status (Value=1).
If no, do you have a custome theme which needs editing (display.template.php)?

DareDevil1990

okay i did what u said ..when i called the file from browser i  get "All Links fetched"  but when i go to post it still doesnt show the message that lc has checked the post etc etc

Lanthan

Quote from: keshav on September 17, 2008, 08:50:30 AM
okay i did what u said ..when i called the file from browser i  get "All Links fetched"  but when i go to post it still doesnt show the message that lc has checked the post etc etc
And did you call the cronrscheckerscript after that script? The submitted script only fills the rs_checker table with the links which needs checking, not more.
And remember, if you have more then 100 Links in it, you must call the cronrschecker script multiple times, until the rs_checker table is empty.

DareDevil1990

okay it worked but its sending pm eveery staff member and not only the topic starter .... please help

Lanthan

it should only send a PM to the post creator.. Not to the staff members.
But if you have a thread with e.g. 10 posts and every post is from a different Member, you would get 10 PM's in total to this members. One PM for every post.

DareDevil1990

ohh...k but this could be a problem with popular thread .... which  has no of replies in them .... i think u should change it to make it alert only the author ,,,

Lanthan

That would not make sense, cause the Thread Starter is only able to edit his own posts, not the posts of other members.
If you don't want at this time the bot to send PM's, disable it at the modsettings. After that no PM's are send. This is a feature for the first time when to much PM's would be send. After a week or so when all old links are checked, you can switch it on again.

Rhine

Quote from: Lanthan on September 17, 2008, 08:39:03 AM
Do you see the "0% of the links are dead" at the bottom of the post?
If yes, so all Links are valid, which you can see in rs_links in the field status (Value=1).
If no, do you have a custome theme which needs editing (display.template.php)?

Value=0 so I guess I need to edit the theme, but where in display.template do I need to edit?

Lanthan

Quote from: Rhine on September 17, 2008, 12:17:19 PM
Value=0 so I guess I need to edit the theme, but where in display.template do I need to edit?

Hope this works for you:

Display.template.php:
Search for this:
echo '
</td>
</tr><tr>
<td valign="bottom" class="smalltext" id="modified_', $message['id'], '">';

// Show "« Last Edit: Time by Person »" if this post was edited.
if ($settings['show_modify'] && !empty($message['modified']['name']))
echo '
« <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], '</i> »';


Add before:
// RS Linkchecker Display the bot message
echo '
</td>
</tr><tr>
<td valign="bottom" class="smalltext" >';
if (!empty($message['botcheck']))
echo '
', $message['botcheck'];
      // End RS Linkchecker Display the bot message

Rhine

#93
Quote from: Lanthan on September 17, 2008, 12:25:46 PM
Quote from: Rhine on September 17, 2008, 12:17:19 PM
Value=0 so I guess I need to edit the theme, but where in display.template do I need to edit?

Hope this works for you:

Display.template.php:
Search for this:
echo '
</td>
</tr><tr>
<td valign="bottom" class="smalltext" id="modified_', $message['id'], '">';

// Show "« Last Edit: Time by Person »" if this post was edited.
if ($settings['show_modify'] && !empty($message['modified']['name']))
echo '
« <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], '</i> »';


Add before:
// RS Linkchecker Display the bot message
echo '
</td>
</tr><tr>
<td valign="bottom" class="smalltext" >';
if (!empty($message['botcheck']))
echo '
', $message['botcheck'];
      // End RS Linkchecker Display the bot message


Yeah it works, one little thing, Its Says 'forum name'(where the topic is inside) Bot checked this like at ....

how do I remove the 'forum name' from the bot message?

Lanthan

For this you have to edit the display.php, thats the only way and will prevent the script to uninstall properly!

Find this in diplay.php
         $bottext = "<b>" . $board_info['name']. " " .$linkbot_name. " " .$txt['rslinkbot_body_start'] . " " . timeformat($message['botchecktime']) . " ".$txt['rslinkbot_body_middle']." " . $message['botpercentdead'] . $txt['rslinkbot_body_end']. "</b>";

change it to:
         $bottext = "<b>" .$linkbot_name. " " .$txt['rslinkbot_body_start'] . " " . timeformat($message['botchecktime']) . " ".$txt['rslinkbot_body_middle']." " . $message['botpercentdead'] . $txt['rslinkbot_body_end']. "</b>";

DareDevil1990

#95
any chances of making this work with .... all the popular file uploading servcies....and one more silly question ...it is just out of curiosity .....


to check the rs links the bot must connect to rs server and to that some coding would be required......


is there any way that i can get the code for all the other popular file sharing services and add it in the mod and it checks all those file services also ....  ;) ;)

Lanthan

I have found a similar script from another team which is able to check other upload sites. I'll get in contact with them, asking if I can use their regular expessions to check for more links.

DareDevil1990

i think that team would be maxwcoders ....as they also have their LCB posted at warez-bb ...if yes it is the team.... i know the code who coded that boot and if u want  i can ask him... for that...

Lanthan

You're right, I'm in contact with dman at this moment.

Lanthan

And I have a GO from him.

So this will be one of the next features I'll implement.

But now, I'm waiting for approval of this mod (Vers. 1.0) from the SMF-Team. So I have made a feature freeze at this time.

Advertisement: