Jump to content

Recommended Posts

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 />"; 
}
}


Link to comment
https://forums.phpfreaks.com/topic/256579-post-picture-not-showing/
Share on other sites

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.

 

 

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.