<?php echo $c_username; ?> </span> </a> <?php // OPTIONS: EDIT AND DELETE if (!empty($arrUser) && (array_search($c_idComment, $optionable_comments) == $arrUser['idUser'] || $arrUser['idUser'] == $p_userId)) { $edit_img_src = rurl() . '/post/edit-icon.png'; $delete_img_src = rurl() . '/post/delete-icon.png'; $submitEdit_style = "background: url('{$edit_img_src}') no-repeat;"; $submitDelete_style = "background: url('{$delete_img_src}') no-repeat;"; ?> <span class="comm_options"> <form action="<?php echo rurl() . '/post/' . $p_idPost . '/' . friendly_str($p_title); ?> " method="post"> <input name="the_key" type="hidden" style="display: none;"value="<?php echo $c_idComment; ?> " /> <input name="submitDelComm" style="<?php echo $submitDelete_style; ?> " type="submit" value=" " title="Delete this comment" onclick="return confirm('Freedom of speech is more sacred than any faith... \n Please, confirm you want to delete the comment.');" /> <input name="submitEditComm" style="<?php echo $submitEdit_style; ?> " type="submit" value=" " title="Edit this comment" onclick="return confirm('Freedom of speech is more sacred than any faith... \n Put an explanation about the reason of this edition. \n And confirm you want to edit the comment.');" /> </form>
} ?> </table> <h2>Published</h2> <?php if (empty($arrPublished)) { echo '<p>No published post yet</p>'; } else { ?> <table style="width: 100%;"> <?php $i = 0; foreach ($arrPublished as $p) { $title = $p['title']; $link = rurl() . '/post/' . $p['idPost'] . '/' . friendly_str($p['title']); $date = $p['date_pub']; $comms = $p['n_comm'] . ' comments'; $extract = cut_string($p['summary'], 25); ?> <tr <?php if ($i % 2 == 0) { echo 'class="i"'; } ?> style="padding: 0;"> <td style="width: 6em;"><?php echo $date; ?> </td> <td style="padding-right: 1em;">
echo '</h3>'; echo '<span class="location">' . $u_location . ' (' . $u_country . ')</span><br />'; echo '<span class="label">' . $u_type . ' since ' . $u_date_created . '</span>'; echo '<br /><span><a class="more" href="' . rurl() . '/user/' . $u_username . '/" title="Visit ' . friendly_str($u_username) . '\'s profile">-more info-</a></span>'; echo '</div>'; } } if (!empty($arr_search_comments)) { echo '<h2 style="clear: both;">Comments</h2>'; } foreach ($arr_search_comments as $c) { extract(strip_slashes_arr($c), EXTR_PREFIX_ALL, 'c'); $c_pic = get_user_pic($c_userId, 32); $c_title = '<a href="' . rurl() . '/post/' . $c_postId . '/' . friendly_str($c_title) . '">' . $c_title . '</a>'; $c_content = cut_string($c_content, 60); $c_content = '<a class="acomm" href="' . rurl() . '/post/' . $c_postId . '/' . friendly_str($c_title) . '#comm_' . $c_idComment . '">' . $c_content . '</a>'; $c_date = date("M j/Y", strtotime($c_date)); echo '<div class="comment_found">'; echo '<p><img src="' . $c_pic . '" alt="' . $c_username . '" title="' . $c_username . '"/>'; echo '<a class="fancy" href="' . rurl() . '/user/show_userinfo.php?id=' . $c_userId . '">' . $c_username . '</a>, on ' . $c_title . ': '; echo '<em>' . $c_content . '</em>'; echo '<span style="color: #505050; font-size: 0.8em;"> (' . $c_date . ')</span>'; echo '</p></div>'; } } // end USERS and COMMENTS FOUND! ?> <!-- PAGINATION --> <?php if ($page != 0) {
$newHeight = $height; } // If user didn't selected a thing we use the same values as the resized one for the cropp. if ($newWidth == 0 || $newHeight == 0) { $t = getimagesize($dirTmpUser . '/' . $imgs . '.jpg'); $newWidth = $t[0]; $newHeight = $t[1]; $width = $t[0]; $height = $t[1]; $x1 = 0; $y1 = 0; } // NAME ... // will have random chars (avoid browser cache) list($num, $tmp) = explode(" ", microtime()); $name = friendly_str($_POST["name"] . '-' . substr($num, 2, 5)); // Create the image for cropping from the resized one stored at temp $img = imagecreatefromjpeg($dirTmpUser . '/' . $imgs . '.jpg'); // Create a blank image to draw the resize / crop over $newImg = imagecreatetruecolor($newWidth, $newHeight); // Do the resize and crop on demand imagecopyresampled($newImg, $img, 0, 0, $x1, $y1, $newWidth, $newHeight, $width, $height); // Store the new image ready to use at post $foto = "../data/images/posts/{$dirImgs}/{$imgs}-{$name}.jpg"; if (!file_exists($foto)) { imagejpeg($newImg, $foto); } else { $error['overwrite'] = 'There is an image with the same name'; } // Clean some imagedestroy($newImg);