The Personal Weblog of Akshay Jain
I was just playing around with PHPLD (PHP Link Directory Script) recently and the most annoying feature in that great script is the lack of a “APPROVE-ALL” button. While, I can understand that such a feature has not been given by default in order to curtail “spam” as lazy people like me would just approve all links without having to look through each one of them.
That would mean more number of Viagra,Pharmacy,Arms, Porn sort of stuff getting listed in directories by the owner who are too lazy manually approve them.
So, here is a nifty piece of code, that you need to put in your “admin” directory and just run this file from you browser. It will automatically “Approve” all pending links.
NOTE: You should keep in mind that this is to be used only after you have manually seen that there are no spam links, otherwise, this code can mean reduction of quality of your directories.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | <?php //PHPLD APPROVE ALL LINKS code snippet // CReated by Akshay Jain http://akshayjain.org //You are free to use this code as you want. Please do not remove the above credits. $db_server = 'localhost'; //leave this unchanched if u dont know what this is. $db_name = 'yourdatabasenamegoeshere'; $db_username = 'database username goes here'; $db_password = 'database password goes here'; $dbconnection = @mysql_connect($db_server,$db_username,$db_password); $db = mysql_select_db($db_name); $result = mysql_query("UPDATE PLD_LINK SET status='2' WHERE status='1'") or die(mysql_error()); ?> |
You can download this code from here: CODE
Note: Please rename this file to .php instead of .txt before uploading.
I am Akshay Jain a student in Economics and a web enthusiast. Most of my readers would be knowing me by my pseudonym champ_rock/champrock. This is my blog and I know I wont be keeping this updated. For contacting me, please use the contact form!
Please subscribe to the RSS feeds in order to get the latest updates on my blog!
ǝlƃooƃ noʎ ʞɔnɟ
airtel
apple
apple itunes
ascii
benchmark
broadband
browser
confidence motion
converter
ebaumsworld
firefox
fun
galwaysidle
Google
google campus ambassador
google gadget
google trends
google trends hacked
google trends spam
gtalk
hacked
hijack
how to poop at work
idle
iim
iim-i
iim pgp
iim student website
image to ascii
indian government
ipod
itunes
latest browsers
opera
opera functions
politics
ram
ram usage
redirect
swastika
taskmanager
trends hacked
typo
virus Broadband (India) (2)
Code Snippets (6)
Economics (1)
General (16)
Google (3)
Indian Politics (1)
Jainism (1)
Latest Buzz (6)
New Scripts (1)
opera (2)
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.
Heeren Tanna
August 4th, 2008 at 10:22 am
hi ,
thx for the code but can u help how to execute multiple quiries .
like
delete from `PLD_LINK` where `TITLE` like ‘%word1%’ ‘%word2%’
same from `DESCRIPTION`& `URL`
Akshay Jain
August 4th, 2008 at 10:35 am
Sorry but I could not understand what you mean by multiple queries?
Can u please explain?
seo services india
August 4th, 2008 at 6:29 pm
i want to deletelink details which contains some words (spam world pills c@sin0 etc )
at present i am executing these one by one .
~~~~~~~~
delete from `PLD_LINK` where `TITLE` like ‘%word1%’
delete from `PLD_LINK` where `title` like ‘%word2%’
delete from `PLD_LINK` where `DESCRIPTION` like ‘%word2%’
delete from `PLD_LINK` where `DESCRIPTION` like ‘%word3%’
delete from `PLD_LINK` where `URL` like ‘%word1%’
delete from `PLD_LINK` where `URL` like ‘%word2%’
~~~~~~~~
instead of doing all these one by one can i run one single query something like
delete from `PLD_LINK` where `URL` & `TITLE` & `DESCRIPTION` like ‘%word2%’, ‘%word2%’
in short i want to delete link if any of the mentioned word found anywhere in title , url or description.
could have done these one by one but i neeed to do this no 100 + dirs thts y lookig for a better solution.
Akshay Jain
August 6th, 2008 at 3:18 pm
Can u please try this ?
delete from `PLD_LINK` where `TITLE`,`title`,`DESCRIPTION`,`URL` like ‘%word1′,%word2%’;
This should work but I havent tried it personally.
Heeren
August 7th, 2008 at 8:06 am
Hi akshay ,
i tried it but it shows error
SQL query:
DELETE FROM `PLD_LINK` WHERE `TITLE` ,
`DESCRIPTION` ,
`URL` LIKE ‘ % word1′ , % word% ’
MySQL said: Documentation
#1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘`DESCRIPTION`,`URL` like %word1%,%word% at line 1
submitqueen
August 20th, 2008 at 9:07 am
I tried it on the phpld free version but it isnt working returning error could you plz let me know whether it works on free version or only on paid version so that i can be clarified whether it is my db error.
Thanks
Akshay Jain
August 22nd, 2008 at 9:24 am
@SubmitQueen : I tried it on the Free version only. That worked fine for me.
Could you please let me know what is the exact error that you are getting?
buy_vigrxplus
July 14th, 2009 at 12:45 pm
Pretty cool post. I just stumbled upon your blog and wanted to say
that I have really liked reading your blog posts. Anyway
I’ll be subscribing to your blog and I hope you post again soon!
Puneet
September 23rd, 2009 at 9:59 am
Hi, Cool and nice blog you have, where can i get the same tags showing widget?
PHPLD: Automatically remove spam submissions - Akshay Jain
November 18th, 2009 at 12:26 pm
[...] is primarily an extension to this post: Approve all links. When you use the above code snippet it will automatically approve all links and all of you using [...]