27, May 2012

Get thumb image from post. - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: Get thumb image from post.
« previous next »
Pages: [1] Print
Instabuck - The easy way to sell digital products online

Author Topic: Get thumb image from post.  (Read 1398 times)
Cyberpunk Wannabe
*
Gender: Male
Posts: 36
244 credits
Members referred : 0


Free php tutorials - http://phpplanet.org/


« on: Jun 15, 2010, 11:12:54 am »

Add this function to function.php file
function getImage($num) {
global $more;
$more = 1;
$link = get_permalink();
$content = get_the_content();
$count = substr_count($content, ?
$start = 0;
for($i=1;$i<=$count;$i++) {
$imgBeg = strpos($content, ?);
$postOutput = substr($post, 0, $imgEnd+1);
$postOutput = preg_replace(?/width=?([0-9]*)? height=?([0-9]*)?/?, ?/width=?117″ height=?68″/?,$postOutput);
$postOutput = preg_replace(?/alignright/?, ?alignleft?,$postOutput);
$image[$i] = $postOutput;
$start=$imgEnd+1;
}
if(stristr($image[$num],??.$image[$num].??; }
$more = 0;
}
and call it as where you want to show image <?php getImage(?1′); ?>  .. inside [...]
« Last Edit: Jun 15, 2010, 12:54:32 pm by Nikolas »
Sandwich Artist
*
Gender: Male
Posts: 26
168 credits
Members referred : 0


« Reply #1 on: Sep 21, 2010, 06:41:20 pm »

OK but where the path of image?
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=10126
Tags : php tutorials Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: Get thumb image from post.
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 08:53:30 pm





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!


Forum Statistics
Total Posts: 62.814
Total Topics: 11.028
Total Members: 21.451
Tutorials : 58
Resources : 929
Designs : 395
Latest Member: sobbin

89 Guests, 2 Users online :

12 users online today:




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.