Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 11-29-2006, 01:39 AM   #1
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
I need a quick php script done......PROGRAMMERS!!!

I have directories with upwards of 2000 files in them

the files all are formatted like this

this-is-the-file.php

what I need to be able to drop a php script in the directory and output html based on the filenames

so if the file name is what I said above, the php script will output

<a target="blank" href="this-is-the-file.php">this is the file</a><br>

it need to take the words in the file name, remove the dashes, add the href tags in there, and output the html to me

I know this is CAKE to do, I just don't have anyone to do it for me right now....how much will someone charge me?
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 02:15 AM   #2
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
anyone?


...........
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 02:18 AM   #3
TampaToker
Confirmed User
 
Join Date: May 2006
Location: Tampa
Posts: 5,827
here is a bump for you
__________________
Icq 247-742-205
TampaToker is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 02:20 AM   #4
jacked
sperm tail
 
jacked's Avatar
 
Industry Role:
Join Date: May 2004
Location: nj
Posts: 11,019
get in touch with WOJ he's reliable and does good work sure he can whip something up for you...

www.wojfun.com
__________________
Got Cam Models?
icq: 361-607-616
jacked is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 02:21 AM   #5
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
Quote:
Originally Posted by jacked View Post
get in touch with WOJ he's reliable and does good work sure he can whip something up for you...

www.wojfun.com
i know woj, he is not on icq right now

I need it done now
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 02:23 AM   #6
jacked
sperm tail
 
jacked's Avatar
 
Industry Role:
Join Date: May 2004
Location: nj
Posts: 11,019
Quote:
Originally Posted by Jace View Post
i know woj, he is not on icq right now

I need it done now
bah that sucks... hope you can find someone
__________________
Got Cam Models?
icq: 361-607-616
jacked is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 02:27 AM   #7
darksoul
Confirmed User
 
darksoul's Avatar
 
Join Date: Apr 2002
Location: /root/
Posts: 4,997
Code:
#/bin/tcsh
foreach file (*.php)
echo -n "<a href='$file'>";
echo $file|sed -e 's/-/ /g'|xargs echo -n;
echo -n "</a>";
end
put that in a file like makelist.csh
upload it and run it in that dir with
./makelist.csh > outputfile.html
__________________
1337 5y54|)m1n: 157717888
BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
Cambooth
darksoul is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 02:29 AM   #8
rounders
Confirmed User
 
Join Date: Sep 2003
Location: p0rn0stars & h0es
Posts: 2,931
darksoul - does kon still run adultxspace?
__________________
ICQ#: 153923840
rounders is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 02:30 AM   #9
darksoul
Confirmed User
 
darksoul's Avatar
 
Join Date: Apr 2002
Location: /root/
Posts: 4,997
Quote:
Originally Posted by rounders View Post
darksoul - does kon still run adultxspace?
no

8chars
__________________
1337 5y54|)m1n: 157717888
BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
Cambooth
darksoul is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 02:32 AM   #10
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
Quote:
Originally Posted by darksoul View Post
Code:
#/bin/tcsh
foreach file (*.php)
echo -n "<a href='$file'>";
echo $file|sed -e 's/-/ /g'|xargs echo -n;
echo -n "</a>";
end
put that in a file like makelist.csh
upload it and run it in that dir with
./makelist.csh > outputfile.html
is that in ssh or something?

i don't do ssh haha
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 02:39 AM   #11
darksoul
Confirmed User
 
darksoul's Avatar
 
Join Date: Apr 2002
Location: /root/
Posts: 4,997
Quote:
Originally Posted by Jace View Post
is that in ssh or something?

i don't do ssh haha
you're missing out
let me try it in php:

Code:
<?php
if($dir = opendir(".")) {
   while (($file = readdir($dir) !== false) {
       if ($file != "." && $file != "..") {
          $text .= "<a href=\"$file\">.str_replace("-"," ",$file)."</a><br>";
       }
    }
}
$fd = fopen("outputfile.html",w);
fwrite($fd,$text);
fclose($fd);
?>
I haven't tested this but should work.
__________________
1337 5y54|)m1n: 157717888
BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
Cambooth
darksoul is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 02:49 AM   #12
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
Quote:
Originally Posted by darksoul View Post
you're missing out
let me try it in php:

Code:
<?php
if($dir = opendir(".")) {
   while (($file = readdir($dir) !== false) {
       if ($file != "." && $file != "..") {
          $text .= "<a href=\"$file\">.str_replace("-"," ",$file)."</a><br>";
       }
    }
}
$fd = fopen("outputfile.html",w);
fwrite($fd,$text);
fclose($fd);
?>
I haven't tested this but should work.
hm...almost


Parse error: syntax error, unexpected '{' in /usr/home/keywords.php on line 3
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 02:52 AM   #13
darksoul
Confirmed User
 
darksoul's Avatar
 
Join Date: Apr 2002
Location: /root/
Posts: 4,997
ia
I forgot to close something should be:
Code:
while (($file = readdir($dir)) !== false) {
__________________
1337 5y54|)m1n: 157717888
BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
Cambooth
darksoul is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 03:01 AM   #14
Tempest
Too lazy to set a custom title
 
Industry Role:
Join Date: May 2004
Location: West Coast, Canada.
Posts: 10,217
If you want to just drop it in a directoty and browse to that file, call it something like "listfiles.php" and change these 3 lines:

$fd = fopen("outputfile.html",w);
fwrite($fd,$text);
fclose($fd);

to simply

echo $text;

then in your browser just:

http ://www.yourdomain.com/pathto/listfiles.php
Tempest is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 03:03 AM   #15
darksoul
Confirmed User
 
darksoul's Avatar
 
Join Date: Apr 2002
Location: /root/
Posts: 4,997
I just spotted a few things I missed there
let me redo it.
__________________
1337 5y54|)m1n: 157717888
BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
Cambooth
darksoul is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 03:08 AM   #16
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
Quote:
Originally Posted by darksoul View Post
ia
I forgot to close something should be:
Code:
while (($file = readdir($dir)) !== false) {
haha, now I got

Parse error: syntax error, unexpected '"' in /usr/home/keywords.php on line 5
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 03:09 AM   #17
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
Quote:
Originally Posted by darksoul View Post
I just spotted a few things I missed there
let me redo it.
has anyone ever told you that you rule?
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 03:12 AM   #18
Tempest
Too lazy to set a custom title
 
Industry Role:
Join Date: May 2004
Location: West Coast, Canada.
Posts: 10,217
Quote:
Originally Posted by Jace View Post
haha, now I got

Parse error: syntax error, unexpected '"' in /usr/home/keywords.php on line 5
Code:
$text .= "<a href=\"$file\">".str_replace("-"," ",$file)."</a><br>";
Tempest is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 03:13 AM   #19
munki
Do Fun Shit.
 
munki's Avatar
 
Industry Role:
Join Date: Dec 2004
Location: OC
Posts: 13,393
You silly php peoples...
__________________

I have the simplest tastes. I am always satisfied with the best.” -Oscar Wilde
munki is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 03:14 AM   #20
darksoul
Confirmed User
 
darksoul's Avatar
 
Join Date: Apr 2002
Location: /root/
Posts: 4,997
Quote:
Originally Posted by Tempest View Post
Code:
$text .= "<a href=\"$file\">".str_replace("-"," ",$file)."</a><br>";
thats what I get for coding directly into the browser
__________________
1337 5y54|)m1n: 157717888
BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
Cambooth
darksoul is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 03:17 AM   #21
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
Quote:
Originally Posted by Tempest View Post
Code:
$text .= "<a href=\"$file\">".str_replace("-"," ",$file)."</a><br>";

PERFECT!

it workjs like a charm!
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 03:19 AM   #22
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
shit, hold up, it is leaving the .php on the end of link
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 03:19 AM   #23
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
Quote:
Originally Posted by munki View Post
You silly php peoples...
didn't know you were awake, I would have bugged you....hahahaha
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 03:22 AM   #24
darksoul
Confirmed User
 
darksoul's Avatar
 
Join Date: Apr 2002
Location: /root/
Posts: 4,997
Here it is
Code:
<?php
if($dir = opendir(".")) {
	while (($file = readdir($dir)) !== false) {
		if($file != "." && $file != ".." &&
		   $file != basename(__file__) &&
		    preg_match("/^.*\.php$/",$file)) {
			$text .= "<a href=\"$file\">";
			$text .= str_replace("-"," ",str_replace(".php","",$file));
			$text .= "</a><br>\n";
		}
	}
}
$fd = fopen("outputfile.html","w");
fwrite($fd,$text);
fclose($fd);
echo "Job done";
?>
Modifyed it to only look for .php files and exclude itself
also removed the ".php" from the title
__________________
1337 5y54|)m1n: 157717888
BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
Cambooth
darksoul is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 03:23 AM   #25
Tempest
Too lazy to set a custom title
 
Industry Role:
Join Date: May 2004
Location: West Coast, Canada.
Posts: 10,217
Quote:
Originally Posted by Jace View Post
shit, hold up, it is leaving the .php on the end of link
Code:
str_replace("-"," ",substr($file,0,-4))
Tempest is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2006, 03:27 AM   #26
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
you all rock so much

anyone who helped me in this thread if you have any links you want across about 50,000 seo'ed pages for the next month or so, let me know

not much traffic, but it will help ya gain some se rankings
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.