Results 11 to 20 of 21
-
27th May 2010, 05:16 PM #11(╯?□?)╯︵ ┻━┻Website's:
Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.comDo you mean one gz contains many files? or may gzips contain one file each?
If they each have one file, you just loop through them or stick them in an object.
for example, off the top of my head:
PHP Code:$files = array('some.gz', 'file.gz', 'made.gz', 'up.gz');
function hostImage($filename) {
$file = gzfile($filename);
$file = implode("\n",$file);
$matches = array(
array('rapidshare.png', '[url=http://rapidshare'),
array('megaupload.png', '[url=http://megaupload')
);
$image = 'none.png';
foreach($matches as $match) {
if(strpos($file, $match[1]) !== false) {
$image = $match[0];
break;
}
}
return $image;
}
foreach($files as $file) {
$image = hostImage($file);
// do other things here
}
Also, this will return 'none.png' if nothing is found.Projects:
WCDDL - The Professional DDL Script
Top Secret Project: In Development - ZOMG
ImgTrack - Never Have Dead Images Again!
-
27th May 2010, 05:22 PM #12OPMemberWebsite's:
maxneeds.info@JmZ
Yea .. They are arround 1300 .gz files in a folder and keep increasing . Each .gz contains only 1 .txt file . I have a path where the .gz files are - $pathz = CONTENT_DIR.$y.'/'.$m;
The path is taking 10 .gz files.When user click the next page it takes the next 10 .gz.
I hope i haven't confused you.
-
27th May 2010, 05:26 PM #13(╯?□?)╯︵ ┻━┻Website's:
Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.comYeah I see.
Well you'd want to find all gz files in the dir first, then loop through like above.
e.g.
change $files at the top of the code, to:
PHP Code:$current_dir = getcwd();
chdir($pathz);
$files = glob('*.gz');
chdir($current_dir);
Projects:
WCDDL - The Professional DDL Script
Top Secret Project: In Development - ZOMG
ImgTrack - Never Have Dead Images Again!
-
27th May 2010, 05:43 PM #14BannedWebsite's:
FusionWarez.info SmokeHost.net Leechers.coCoding Geek battle =/
-
27th May 2010, 05:44 PM #15OPMemberWebsite's:
maxneeds.infoIt is content/10/05
I triedCode:$pathz = CONTENT_DIR.$y.'/'.$m.'/'.$glo; $glo=glob('*.gz'); echo $pathz;
-
27th May 2010, 06:06 PM #16MemberWebsite's:
litewarez.net litewarez.com triniwarez.comPHP Code:/*
*Functions
*/
function hostImage($filename) {
$file = gzfile($filename);
$file = implode("\n",$file);
$matches = array(
array('rapidshare.png', '[url=http://rapidshare'),
array('megaupload.png', '[url=http://megaupload')
);
$image = 'none.png';
foreach($matches as $match) {
if(strpos($file, $match[1]) !== false) {
$image = $match[0];
break;
}
}
return $image;
}
//Ditrectory stuff
$gdir = CONTENT_DIR.$y.'/'.$m.'/*.gz';
foreach(glob($gdir) as $file)
{
$image = hostImage(CONTENT_DIR.$y.'/'.$m.'/' . $file);
echo $image; // rapidshare.png or megaupload.png
}
Join Litewarez.net today and become apart of the community.
Unique | Clean | Advanced (All with you in mind)
Downloads | Webmasters
Notifications,Forum,Chat,Community all at Litewarez Webmasters
-
27th May 2010, 06:11 PM #17OPMemberWebsite's:
maxneeds.infoWarning: gzfile(content/10/05/content/10/05/entry100501-210451.txt.gz) [function.gzfile]: failed to open stream: No such file or directory
the bolded shouldnt exist..
-
27th May 2010, 08:59 PM #18Respected Member
Wow what a blob of too many coders.
First let me say I have no idea where your code came from as I don't see content_dir being defined anywhere.
But looking at what it is producing try removing the content_dir. from the command whatever it was.
Seeing what your total code is for these routines would be nice since you are following 2 peoples advice.
-
27th May 2010, 09:02 PM #19MemberWebsite's:
litewarez.net litewarez.com triniwarez.comno:
Chnage
$image = hostImage(CONTENT_DIR.$y.'/'.$m.'/' . $file);
to
$image = hostImage($file);
i forgot glob returns an absolute pathJoin Litewarez.net today and become apart of the community.
Unique | Clean | Advanced (All with you in mind)
Downloads | Webmasters
Notifications,Forum,Chat,Community all at Litewarez Webmasters
-
28th May 2010, 11:54 AM #20OPMemberWebsite's:
maxneeds.infoThanks guys !
I managed to get it working...
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
[Selling] .:: Clip23.Com ::. Having a video site should not be complicated
By errabbaa in forum Completed TransactionsReplies: 1Last Post: 16th Sep 2012, 12:14 AM -
So, the question is:
By M.D.House in forum General DiscussionReplies: 6Last Post: 15th Nov 2011, 02:52 AM -
Question
By UmairDiGrt in forum OtherReplies: 5Last Post: 14th Aug 2011, 09:01 AM -
Question
By MasterDKR in forum Webmaster DiscussionReplies: 13Last Post: 3rd Sep 2010, 04:28 AM -
question about windows server before i buy and question about wrzhost
By priviet02 in forum Hosting DiscussionReplies: 5Last Post: 3rd Jan 2010, 05:23 PM
themaPoster - post to forums and...
Version 5.22 released. Open older version (or...