Glenskie Posted February 7, 2012 Share Posted February 7, 2012 here is my code , its supposed to show a picture , but it doesnt i use a function in a function ... function posts function posts($query, $action_type) { $session = $logOptions_id; if($action_type=="newPost") { $class = "class='new'"; } else { $class = ""; } while($row = mysql_fetch_array($query)) { $id = $row['id']; $to_id = $row['to_id']; $from_id = $row['from_id']; $post = stripslashes(linkify(nl2br(htmlentities($row['post'])))); $type = $row['type']; $state = $row['state']; $date = time_stamp($row['date']); ?> <li id=<?php print $id?>> <div class="post-left"></div> <div class="post-right"> <!---ARROW--> <div class="arrow-border"><div class="arrow"></div></div> <div class="post-body"><div class="post-Spic"><?php Spic($from_id, 55)?></div><?php print $post?></div> <div class="post-top"> <a class="post-name" href="profile.php?id=<?php print $from_id?>"><?php name($from_id)?></a> | <a href="#/posts&id=<?php print $id?>" class="post-date" title="<?php print date('l, jS \of F, Y \a\t g:ia ', $row['date']);?>"><?php print $date?></a> | <a class="post-comment" id="comment-toggle<?php print $id?>" onClick="comment_toggle('<?php print $id?>')">Comment</a> |<?php/*<a class="post-like" id="PostLike<?php print $id?>" onClick="<?php print $like_unlike?>('<?php print $id?>')"><?php print ucwords($like_unlike)?></a> <div class="num-likes" id="NumLikes<?php print $id?>"><?php print $num_likes?>*/?></div> </div> </li> function Spic function Spic($id, $px) { if($px) { if($px>=0&&$px<=42) { $size = "_30"; } else if($px>=43&&$px<=70) { $size = "_55"; } else if($px>=71&&$px<=97) { $size = "_85"; } else if($px>=98&&$px<=155) { $size = "_110"; } else if($px>=156&&$px<=425) { $size = "_200"; } else if($px>=426) { $size = "_650"; } } else { $size = ''; } { $check_pic = "members/$id/image01.jpg"; $default_pic = "members/0/image01.jpg"; if (file_exists($check_pic)) { $user_pic = "<img src=\"$check_pic?$cacheBuster\" $size />"; } else { $user_pic = "<img src=\"$default_pic\" $size />"; } } Quote Link to comment https://forums.phpfreaks.com/topic/256579-post-picture-not-showing/ Share on other sites More sharing options...
spiderwell Posted February 7, 2012 Share Posted February 7, 2012 what is in the img src? and what is the $cachebuster? is that affecting the image source? Quote Link to comment https://forums.phpfreaks.com/topic/256579-post-picture-not-showing/#findComment-1315409 Share on other sites More sharing options...
Glenskie Posted February 7, 2012 Author Share Posted February 7, 2012 i think you can take the $cashebuster away , and the src is right there , $check_pic = "members/$id/image01.jpg"; Quote Link to comment https://forums.phpfreaks.com/topic/256579-post-picture-not-showing/#findComment-1315513 Share on other sites More sharing options...
ManiacDan Posted February 7, 2012 Share Posted February 7, 2012 Your functions don't return anything. Have you attempted any kind of debugging on your own? Have you tried to DIE with these variables? Have you tried to view the source? You can't simply dump 200 lines of unformatted code on a group of strangers and expect us to do your work for you. Quote Link to comment https://forums.phpfreaks.com/topic/256579-post-picture-not-showing/#findComment-1315547 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.