28, May 2012

import templates script - folder directive? - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Miscellaneous scripts or snippets (Moderator: Olaf)
Topic: import templates script - folder directive?
« previous next »
Pages: [1] Print

Author Topic: import templates script - folder directive?  (Read 2939 times)
I crack Photoshop!
*
Gender: Female
Posts: 3
22 credits
Members referred : 0



« on: Jul 05, 2006, 10:54:35 am »

Hi Olaf!

Great script! thanks.
 
But the thumbnails are not showing because the directory stucture is different. There is an additional folder eg. 1500 before the file name. What is the correct code to specify the thumbs folder and sub folders before the image correctly?

example:
it is looking for:
http://www.designertemplates.biz/thumbs/4429-m.jpg

but the images are in:
http://www.designertemplates.biz/thumbs/4400/4429-m.jpg

These are the example pages:
http://www.designertemplates.biz/classes/import_templates/example.php
http://www.designertemplates.biz/classes/import_templates/get_banner_data.php
 
Thanks a ton!
Priya
« Last Edit: Jul 05, 2006, 11:03:50 am by priyawil »
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: Jul 05, 2006, 11:30:35 am »

Hello,

in both examples is the parameter "$zero_tumbs" set to true, check the method:

Code:
<?php
function 
copy_thumbs($id$zero_tumbs false) {
$file_name $id."-m.jpg";
$in_folder = ($id >= 100) ? floor($id/100)."00/" "0/";
$src REMOTE_SCREENSHOTS.$in_folder.$file_name;
if ($zero_tumbs) {
$dest $_SERVER['DOCUMENT_ROOT'].THUMB_FOLDER.$file_name;
} else {
if (!is_dir($_SERVER['DOCUMENT_ROOT'].THUMB_FOLDER.$in_folder)) {
umask(0);
mkdir($_SERVER['DOCUMENT_ROOT'].THUMB_FOLDER.$in_folder0777);
}
$dest $_SERVER['DOCUMENT_ROOT'].THUMB_FOLDER.$in_folder.$file_name;
}
if (!$fs fopen($src"rb")) {
return false;
} else {
$data "";
while (!feof ($fs)) {
$data .= fgets ($fs1024);
}
fclose($fs);
if (!$fd fopen($dest"wb")) {
return false;
} else {
fwrite($fd$data);
fclose($fd);
chmod($dest0644);
flush();
return true;
}
}
}

The example "get_thumbs.php" is using the default setting that's why the thumbs are downloaded.

I crack Photoshop!
*
Gender: Female
Posts: 3
22 credits
Members referred : 0



« Reply #2 on: Jul 05, 2006, 12:07:20 pm »

The parameter "$zero_tumbs" is set to false in import_templates.php. Should I change it to true?

and then use  "get_thumbs.php" to download the thumbs again?
« Last Edit: Jul 05, 2006, 12:25:58 pm by priyawil »
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Jul 05, 2006, 12:38:34 pm »

The parameter "$zero_tumbs" is set to false in import_templates.php. Should I change it to true?

and then use  "get_thumbs.php" to download the thumbs again?

no, the default inside class is OK, the only think you need to do is to write you script for the presentation of the data, like I did at all4yourwebsite.com.

That code is not included...

I crack Photoshop!
*
Gender: Female
Posts: 3
22 credits
Members referred : 0



« Reply #4 on: Jul 05, 2006, 12:54:04 pm »

Sorry, I thought "example.php" and "get_banner_data.php" are coded to present some of the templates...and when they did not work I thought that I must have installed your code wrong...as I don't know php.. thanks for your help...
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #5 on: Jul 05, 2006, 01:02:08 pm »

Sorry, I thought "example.php" and "get_banner_data.php" are coded to present some of the templates...and when they did not work I thought that I must have installed your code wrong...as I don't know php.. thanks for your help...

No problem, If you don't have any php skills it should be difficult to you to build your own template shop, at minimum you need knowledge about how to read data from a DB and present this data using php...

Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=3139
Tags : php design Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Miscellaneous scripts or snippets (Moderator: Olaf)
Topic: import templates script - folder directive?
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 11:52:00 am





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.