1
Mods & Plugins (Releases & Support) / Re: [Mod] New images since last visit
« on: April 27, 2006, 03:15:09 AM »
the page_header.php wasn't changed carefully
thank you V@no
thank you V@no
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
I found it .. I was searching with a space before the line ..
ok I did every thing .. but the link doesn't appear
this is the link :
» <a href="{url_new_images_last}">{lang_new_images_last}</a><br />
I put it in the userlogininfo template
DB Error: Bad SQL Query: INSERT INTO 4images_users (user_id, user_level, user_name, user_password, user_email, user_showemail, user_allowemails, user_invisible, user_joindate, user_activationkey, user_lastaction, user_lastvisit, user_comments, user_homepage, user_icq, user_limit) VALUES (177, 2, 'nasser', '96e79218965eb72c92a549dd5a330112', 'poet@emarati.net', 1, 1, 0, 1145880262, 'c8853c51fdd7f8ae824e066b558f93ea', 1145880262, 1145880262, 0, '', '', )
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 4
name: is_read
type: tinyint(1)
null: no
default: 0
$site_template->register_vars(array(
"media_url" => MEDIA_PATH,
$sql = "SELECT c.comment_id
FROM ".COMMENTS_TABLE." c
LEFT JOIN ".IMAGES_TABLE." i ON i.image_id = c.image_id
WHERE i.user_id = ".$user_info['user_id']." AND c.is_read = 0";
$result = $site_db->query($sql);
$new_comments = $site_db->get_numrows($result);
"url_new_images" => $site_sess->url(ROOT_PATH."search.php?search_new_images=1"),
"new_comments" => $new_comments,
"url_comments" => $site_sess->url(ROOT_PATH."member.php?action=readcomments"),
//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
if ($action == "readcomments") {
if ($user_info['user_level'] == GUEST) {
header("Location: ".$site_sess->url($url, "&"));
exit;
}
$txt_clickstream = "Comments";
if (isset($HTTP_POST_VARS['commentsetperpage']) || isset($HTTP_GET_VARS['commentsetperpage'])) {
$commentsetperpage = (intval($HTTP_POST_VARS['commentsetperpage']) ) ? intval($HTTP_POST_VARS['commentsetperpage']) : intval($HTTP_GET_VARS['commentsetperpage']);
if ($commentsetperpage) {
$site_sess->set_session_var("commentperpage", $commentsetperpage);
$session_info['commentperpage'] = $commentsetperpage;
}
}
if (isset($session_info['commentperpage'])) {
$commentperpage = $session_info['commentperpage'];
}
else {
$commentperpage = 5;
}
$commentsperpage_dropdown = "n<select name=\"commentsetperpage\" onchange=\"if (this.options[this.selectedIndex].value != 0){ forms['commentsperpage'].submit() }\" class=\"select\">n";
for($i = 1; $i <= 15; $i++) {
$setvalue = 1 * $i;
$commentsperpage_dropdown .= "<option value=\"".$setvalue."\"";
if ($setvalue == $commentperpage) {
$commentsperpage_dropdown .= " selected=\"selected\"";
}
$commentsperpage_dropdown .= ">";
$commentsperpage_dropdown .= $setvalue;
$commentsperpage_dropdown .= "</option>n";
}
$commentsperpage_dropdown .= "</select>n";
$site_template->register_vars("commentsperpage_dropdown", $commentsperpage_dropdown);
$commentsperpage_dropdown_form = $site_template->parse_template("member_commentsdropdown_form");
$site_template->register_vars("commentsperpage_dropdown_form", $commentsperpage_dropdown_form);
$sql = "SELECT COUNT(c.comment_id) AS comments
FROM ".COMMENTS_TABLE." c
LEFT JOIN ".IMAGES_TABLE." i ON i.image_id = c.image_id
WHERE i.user_id = ".$user_info['user_id']." AND c.is_read = 0";
$result = $site_db->query_firstrow($sql);
$site_db->free_result();
$num_comments = $result['comments'];
if ($action == "postcomment") {
$page = ceil($num_comments / $commentperpage);
}
$num_rows_all = (isset($num_comments)) ? $num_comments : 0;
$link_arg = $site_sess->url(ROOT_PATH."member.php?action=readcomments");
include(ROOT_PATH.'includes/paging.php');
$getpaging = new Paging($page, $commentperpage, $num_rows_all, $link_arg, $lang['comment_stats'], "comments");
$offset = $getpaging->get_offset();
$get_comment_stats = ($num_comments) ? $getpaging->get_paging_stats() : "";
$comment_stats = preg_replace("/image/", "comment", $get_comment_stats);
$site_template->register_vars(array(
"paging" => $getpaging->get_paging(),
"paging_stats" => $comment_stats
));
$additional_sql = "";
if (!empty($additional_user_fields)) {
$table_fields = $site_db->get_table_fields(USERS_TABLE);
foreach ($additional_user_fields as $key => $val) {
if (isset($HTTP_POST_VARS[$key]) && isset($table_fields[$key])) {
$additional_sql .= ", $key = '".un_htmlspecialchars(trim($HTTP_POST_VARS[$key]))."'";
}
}
}
$sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date, i.image_name".get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email").get_user_table_field(", u.", "user_showemail").get_user_table_field(", u.", "user_invisible").get_user_table_field(", u.", "user_joindate").get_user_table_field(", u.", "user_lastaction").get_user_table_field(", u.", "user_comments").get_user_table_field(", u.", "user_homepage").get_user_table_field(", u.", "user_icq")."
FROM ".COMMENTS_TABLE." c
LEFT JOIN ".IMAGES_TABLE." i ON i.image_id = c.image_id
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
WHERE i.user_id = ".$user_info['user_id']." AND c.is_read = 0
ORDER BY c.comment_date ASC
LIMIT $offset, $commentperpage";
$result = $site_db->query($sql);
$comment_row = array();
while ($row = $site_db->fetch_array($result)) {
$comment_row[] = $row;
}
$site_db->free_result($result);
$num_comments = sizeof($comment_row);
if (!$num_comments) {
$comments = "<tr><td class=\"commentrow1\" colspan=\"2\"> There currently are no comments. </td></tr>";
}
else {
$comments = "";
$bgcounter = 0;
for ($i = 0; $i < $num_comments; $i++) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$comment_user_email = "";
$comment_user_email_save = "";
$comment_user_mailform_link = "";
$comment_user_email_button = "";
$comment_user_homepage_button = "";
$comment_user_icq_button = "";
$comment_user_profile_button = "";
$comment_user_status_img = REPLACE_EMPTY;
$comment_user_name = htmlspecialchars($comment_row[$i]['comment_user_name']);
$comment_user_info = $lang['userlevel_guest'];
$comment_user_id = $comment_row[$i]['user_id'];
if (isset($comment_row[$i][$user_table_fields['user_name']]) && $comment_user_id != GUEST) {
$comment_user_name = htmlspecialchars($comment_row[$i][$user_table_fields['user_name']]);
$comment_user_profile_link = !empty($url_show_profile) ? $site_sess->url(preg_replace("/{user_id}/", $comment_user_id, $url_show_profile)) : $site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$comment_user_id);
$comment_user_profile_button = "<a href=\"".$comment_user_profile_link."\"><img src=\"".get_gallery_image("profile.gif")."\" border=\"0\" alt=\"".$comment_user_name."\" /></a>";
$comment_user_status_img = ($comment_row[$i][$user_table_fields['user_lastaction']] >= (time() - 300) && ((isset($comment_row[$i][$user_table_fields['user_invisible']]) && $comment_row[$i][$user_table_fields['user_invisible']] == 0) || $user_info['user_level'] == ADMIN)) ? "<img src=\"".get_gallery_image("user_online.gif")."\" border=\"0\" alt=\"Online\" />" : "<img src=\"".get_gallery_image("user_offline.gif")."\" border=\"0\" alt=\"Offline\" />";
$comment_user_homepage = (isset($comment_row[$i][$user_table_fields['user_homepage']])) ? format_url($comment_row[$i][$user_table_fields['user_homepage']]) : "";
if (!empty($comment_user_homepage)) {
$comment_user_homepage_button = "<a href=\"".$comment_user_homepage."\" target=\"_blank\"><img src=\"".get_gallery_image("homepage.gif")."\" border=\"0\" alt=\"".$comment_user_homepage."\" /></a>";
}
$comment_user_icq = (isset($comment_row[$i][$user_table_fields['user_icq']])) ? $comment_row[$i][$user_table_fields['user_icq']] : "";
if (!empty($comment_user_icq)) {
$comment_user_icq_button = "<a href=\"http://wwp.icq.com/scripts/search.dll?to=".$comment_user_icq."\" target=\"_blank\"><img src=\"http://web.icq.com/whitepages/online?icq=".$comment_user_icq."&img=5\" width=\"18\" height=\"18\" border=\"0\" alt=\"".$comment_user_icq."\" /></a>";
}
if (!empty($comment_row[$i][$user_table_fields['user_email']]) && (!isset($comment_row[$i][$user_table_fields['user_showemail']]) || (isset($comment_row[$i][$user_table_fields['user_showemail']]) && $comment_row[$i][$user_table_fields['user_showemail']] == 1))) {
$comment_user_email = $comment_row[$i][$user_table_fields['user_email']];
$comment_user_email_save = str_replace("@", " at ", $comment_row[$i][$user_table_fields['user_email']]);
if (!empty($url_mailform)) {
$comment_user_mailform_link = $site_sess->url(preg_replace("/{user_id}/", $comment_user_id, $url_mailform));
}
else {
$comment_user_mailform_link = $site_sess->url(ROOT_PATH."member.php?action=mailform&".URL_USER_ID."=".$comment_user_id);
}
$comment_user_email_button = "<a href=\"".$comment_user_mailform_link."\"><img src=\"".get_gallery_image("email.gif")."\" border=\"0\" alt=\"".$comment_user_email_save."\" /></a>";
}
if (!isset($comment_row[$i][$user_table_fields['user_level']]) || (isset($comment_row[$i][$user_table_fields['user_level']]) && $comment_row[$i][$user_table_fields['user_level']] == USER)) {
$comment_user_info = $lang['userlevel_user'];
}
elseif ($comment_row[$i][$user_table_fields['user_level']] == ADMIN) {
$comment_user_info = $lang['userlevel_admin'];
}
$comment_user_info .= "<br />";
$comment_user_info .= (isset($comment_row[$i][$user_table_fields['user_joindate']])) ? "<br />".$lang['join_date']." ".format_date($config['date_format'], $comment_row[$i][$user_table_fields['user_joindate']]) : "";
$comment_user_info .= (isset($comment_row[$i][$user_table_fields['user_comments']])) ? "<br />".$lang['comments']." ".$comment_row[$i][$user_table_fields['user_comments']] : "";
}
$comment_user_ip = ($user_info['user_level'] == ADMIN) ? $comment_row[$i]['comment_ip'] : "";
$admin_links = "";
if ($user_info['user_level'] == ADMIN) {
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=editcomment&comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['edit']."</a> ";
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=removecomment&comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['delete']."</a>";
}
elseif ($is_image_owner) {
$admin_links .= ($config['user_edit_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a> ";
$admin_links .= ($config['user_delete_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['delete']."</a>";
}
$image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row[$i]['image_id']);
$image_link = "<b><a href=\"".$image_url."\">".$comment_row[$i]['image_name']."</a></b>";
$site_template->register_vars(array(
"count" => $i,
"image_name" => $image_link,
"comment_id" => $comment_row[$i]['comment_id'],
"comment_user_id" => $comment_user_id,
"comment_user_status_img" => $comment_user_status_img,
"comment_user_name" => $comment_user_name,
"comment_user_info" => $comment_user_info,
"comment_user_profile_button" => $comment_user_profile_button,
"comment_user_email" => $comment_user_email,
"comment_user_email_save" => $comment_user_email_save,
"comment_user_mailform_link" => $comment_user_mailform_link,
"comment_user_email_button" => $comment_user_email_button,
"comment_user_homepage_button" => $comment_user_homepage_button,
"comment_user_icq_button" => $comment_user_icq_button,
"comment_user_ip" => $comment_user_ip,
"comment_headline" => format_text($comment_row[$i]['comment_headline'], 0, $config['wordwrap_comments'], 0, 0),
"comment_text" => format_text($comment_row[$i]['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']),
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $comment_row[$i]['comment_date']),
"row_bg_number" => $row_bg_number,
"admin_links" => $admin_links
));
$comments .= $site_template->parse_template("member_comment_bit");
} // end while
} //end else
$site_template->register_vars("comments", $comments);
unset($comments);
$content = $site_template->parse_template("member_comments");
}
if ($action == "removecomments") {
if ($user_info['user_level'] == GUEST) {
header("Location: ".$site_sess->url($url, "&"));
exit;
}
$remove_id = ($HTTP_POST_VARS['remove_id']) ? $HTTP_POST_VARS['remove_id'] : $HTTP_GET_VARS['remove_id'];
if($remove_id){
foreach ($remove_id as $key => $remove_id) {
$sql = "UPDATE ".COMMENTS_TABLE."
SET is_read = 1
WHERE comment_id = $remove_id";
$site_db->query($sql);
}
}
$member_comments_url = $site_sess->url(ROOT_PATH."member.php?action=readcomments");
$member_comments = "<b><a href=\"".$member_comments_url."\">Here</a></b>";
$content = "<meta http-equiv=\"refresh\" content=\"1; url=".$site_sess->url(ROOT_PATH."member.php?action=readcomments\"><div align=\"center\"> <b>Comments removed from list.</b> <br> If you are not automatically returned please click ".$member_comments."");
}
<tr>
<td class="commentrow{row_bg_number}" nowrap="nowrap"> <strong>{image_name}</strong></td>
<td class="commentrow{row_bg_number}" nowrap="nowrap"><div align="right">Mark
as read:
<input type="checkbox" name="remove_id[{count}]" value="{comment_id}">
</div></td>
</tr>
<tr>
<td class="commentrow{row_bg_number}" valign="top" nowrap="nowrap"> <b>{comment_user_name}</b><br />
{comment_user_info} {if comment_user_ip}<br /> <br /> <b>IP:</b> {comment_user_ip}{endif
comment_user_ip} </td>
<td width="100%" class="commentrow{row_bg_number}" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><b>{comment_headline}</b></td>
<td valign="top" align="right">{if admin_links}{admin_links}{endif admin_links}</td>
</tr>
</table>
<hr size="1" />
{comment_text} </td>
</tr>
<tr>
<td class="commentrow{row_bg_number}" nowrap="nowrap"> <span class="smalltext">{comment_date}</span>
</td>
<td class="commentrow{row_bg_number}"> {comment_user_status_img} {comment_user_profile_button}
{comment_user_email_button} {comment_user_homepage_button} {comment_user_icq_button}
</td>
</tr>
<tr>
<td colspan="2" class="commentspacerrow"><img src="{template_url}/images/spacer.gif" width="1" height="1" alt="" /></td>
</tr>
<script language="JavaScript">
<!--
function CheckAll(check) {
for (var i=0;i<document.form.elements.length;i++) {
var e = document.form.elements[i];
if ((e.name != 'allbox') && (e.type=='checkbox')) {
e.checked = (check) ? true : document.form.allbox.checked;
}
}
}
// -->
</script>
<a name="comments"></a> {if paging_stats}
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="bordercolor">
<tr>
<td> <table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td class="row1" valign="middle"> {paging_stats} </td>
<td class="row1" valign="top" align="right"> {commentsperpage_dropdown_form}
</td>
</tr>
</table></td>
</tr>
</table>
<br />
{endif paging_stats} {if paging}
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="bordercolor">
<tr>
<td> <table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td class="row1" valign="top">{paging}</td>
<td class="row1" valign="top"> </td>
</tr>
</table></td>
</tr>
</table>
<br />
{endif paging}
<form name="form" action="{self}" method="post">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="head1" valign="top"> <table width="100%" border="0" cellpadding="3" cellspacing="1">
<tr>
<td valign="top" class="head1">Image & Author</td>
<td valign="top" class="head1">Comment</td>
</tr>
{comments} </table></td>
</tr>
</table>
<br />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%"> <input type="hidden" name="action" value="removecomments" />
<input type="submit" name="Submit" value="Remove Selected" /> </td>
<td width="50%"> <div align="right">Check All:
<input name="allbox" type="checkbox" onClick="CheckAll();" style="height: 13px; width: 13px;" />
</div></td>
</tr>
</table>
</form>
<table border="0" cellspacing="0" cellpadding="0">
<form method="post" action="{self}?action=readcomments#comments" name="commentsperpage">
<tr>
<td>Comments per page: </td>
<td>{commentsperpage_dropdown}</td>
</tr>
</form>
</table>
» <a href="{url_comments}">Comments ({new_comments})</a></td>