Jump to content

Strtolower Casuing Directory Path of Images to go Lowercase. HELP


Recommended Posts

Hi Simon, the strtolower is casuing few issues, some are related to file path of images and actual files and some are relatedt o Meta Titles.

I have used strtolower to lowercase my urls, this code is successfully making urls go lowercase, but for some reasons, its also casuing the image pathfile go lowercase, specifically the $cat. I want to keep my lowercase url structure, but i want my image path to be as it is, so that i dont have to go and rename 100s of categories lowercase. Following is the code.

 

<li><a href="<?=$root_domain?>cell-phone-screensavers/<?php echo strtolower($brandname)?>-<?php echo strtolower($phonename)?>-<?php echo strtolower($cat)?>-mobile-screensavers-download-<?=$grow['id']?>.php">

	<img style="border: 1px solid #232323" src="hxxp://domain.com/mobilecontents/ss/<?=$seriestitle?>/<?=$cat?>/thumb_<?=$grow['name']?>" alt="" width="100" height="100"></a>Size <?=$img_bytes;?> KB</li>

 

This code, is successfully making urls go lower case, but its also causing the category path for images go lowercase, but in my ftp, the categories are like Adventure  with capital A, following is my url, scroll down to spot the error

 

http://bit.ly/msOano

 

Script is trying to pull image file from

 

mobilecontents/ss/240X320/abstract/

 

but the actual path is

 

mobilecontents/ss/240X320/Abstract

 

How to address this issue? i have renamed directories to lowercase in some sections  but in Screensavers and Wallpaper, i have way too many categories to rename to lowercase.

 

You have any words on it?

 

Thanks

 

 

Change strtolower function

<?php echo strtolower($cat)?>

to the ucwords function

<?php echo ucwords($cat)?>

 

Ucwords only capitalises the first letter within the word(s). The rest of the letters will be lowercase.

Wildteen88, thanks, that worked, page is now loading images from directory, but its causing another warning http://bit.ly/msOano . It is supposed to echo image file size, but showing errors there. Is it because its confused between directory path or what? following is the code.

 

<li><a href="<?=$root_domain?>cell-phone-screensavers/<?php echo strtolower($brandname)?>-<?php echo strtolower($phonename)?>-<?php echo strtolower($cat)?>-mobile-screensavers-download-<?=$grow['id']?>.php">

	<img style="border: 1px solid #232323" src="http://mobilephones.pk/mobilecontents/ss/<?=$seriestitle?>/<?php echo ucwords($cat)?>/thumb_<?=$grow['name']?>" alt="" width="100" height="100"></a>Size <?=$img_bytes;?> KB</li>
<?
}
}else{
?>
No Screensaver Found For <?=$mobilename?>

That displays image size under image, it will work perfectly fine if i actually make the category lowercase in ftp and remove echo ucword string, but there are like 200 categories which i will have to lowercase manually. Let me paste the full code.

 

while($grow = mysql_fetch_array($sqlwpslist)){	
	$image_name = $grow['name'];
	$filedir = '/home/pspspot/public_html/mobilephones.pk/mobilecontents/ss/'.$seriestitle.'/'.$cat.'/'.$image_name;
	$img_bytes = ceil(filesize($filedir)/1024);
?>
	<li><a href="<?=$root_domain?>cell-phone-screensavers/<?php echo strtolower($brandname)?>-<?php echo strtolower($phonename)?>-<?php echo strtolower($cat)?>-mobile-screensavers-download-<?=$grow['id']?>.php">

	<img style="border: 1px solid #232323" src="http://mobilephones.pk/mobilecontents/ss/<?=$seriestitle?>/<?php echo ucwords($cat)?>/thumb_<?=$grow['name']?>" alt="" width="100" height="100"></a>Size <?=$img_bytes;?> KB</li>
<?
}
}else{
?>
No Screensaver Found For <?=$mobilename?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.