462 lines
19 KiB
Smarty
462 lines
19 KiB
Smarty
{include file='header.tpl'}
|
|
|
|
{* $Id: blog.tpl 162 2009-04-30 01:43:11Z john $ *}
|
|
|
|
{* JAVASCRIPT *}
|
|
{lang_javascript id=861}
|
|
<script type="text/javascript" src="./include/js/class_blog.js"></script>
|
|
<script type="text/javascript">
|
|
|
|
SocialEngine.Blog = new SocialEngineAPI.Blog();
|
|
SocialEngine.RegisterModule(SocialEngine.Blog);
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
{* BLOG ENTRIE(S) *}
|
|
<table cellpadding='0' cellspacing='0' class="seBlogTable">
|
|
<tr>
|
|
<td class="seBlogColumnLeft" valign="top">
|
|
|
|
|
|
{section name=entries_loop loop=$entries}
|
|
<div class="seBlogEntry seBlogEntry{cycle values='1,2'}">
|
|
|
|
{* MAKE SURE TITLE IS NOT BLANK *}
|
|
{if $entries[entries_loop].blogentry_title != ""}
|
|
{assign var='blogentry_title' value=$entries[entries_loop].blogentry_title}
|
|
{else}
|
|
{lang_block id=1500015 var=blogentry_title}{/lang_block}
|
|
{/if}
|
|
|
|
<table cellpadding='0' cellspacing='0' class="seBlogEntryTable">
|
|
<tr>
|
|
<td valign='top'>
|
|
<div class='seBlogEntryTitle'>
|
|
<a href='{$url->url_create("blog_entry", $owner->user_info.user_username, $entries[entries_loop].blogentry_id)}'>{$blogentry_title}</a>
|
|
</div>
|
|
<div class='seBlogEntryDate'>
|
|
{lang_print id=1500016}
|
|
{$datetime->cdate("`$setting.setting_dateformat`", $datetime->timezone("`$entries[entries_loop].blogentry_date`", $global_timezone))}
|
|
-
|
|
<a href='{$url->url_create("blog_entry", $owner->user_info.user_username, $entries[entries_loop].blogentry_id)}'>{$entries[entries_loop].blogentry_totalcomments} comment{if $entries[entries_loop].blogentry_totalcomments!=1}s{/if}</a>
|
|
[ <a href='{$url->url_create("blog_entry", $owner->user_info.user_username, $entries[entries_loop].blogentry_id)}'>{lang_print id=1500021}</a> ]
|
|
-
|
|
<a href='{$url->url_create("blog_entry", $owner->user_info.user_username, $entries[entries_loop].blogentry_id)}'>
|
|
{$entries[entries_loop].blogentry_totaltrackbacks} trackback{if $entries[entries_loop].blogentry_totaltrackbacks!=1}s{/if}
|
|
</a>
|
|
[ <a href='{$url->url_create("blog_trackback", $owner->user_info.user_username, $entries[entries_loop].blogentry_id)}'>{lang_print id=1500022}</a> ]
|
|
</div>
|
|
{* SHOW ENTRY CATEGORY *}
|
|
{if !empty($entries[entries_loop].blogentry_blogentrycat_id)}
|
|
<div class='seBlogEntryCategory'>
|
|
Category:
|
|
{if !$entries[entries_loop].blogentrycat_user_id}<a href='browse_blogs.php?c={$entries[entries_loop].blogentry_blogentrycat_id}'>{/if}
|
|
{if !empty($entries[entries_loop].blogentrycat_languagevar_id)}
|
|
{capture assign=blogentrycat_title}{lang_print id=$entries[entries_loop].blogentrycat_languagevar_id}{/capture}
|
|
{else}
|
|
{assign var=blogentrycat_title value=$entries[entries_loop].blogentrycat_title}
|
|
{/if}
|
|
{$blogentrycat_title|truncate:97}
|
|
{if !$entries[entries_loop].blogentrycat_user_id}</a>{/if}
|
|
</div>
|
|
{/if}
|
|
<div class='seBlogEntryBody' style="overflow: auto;">
|
|
{$entries[entries_loop].blogentry_body|choptext:75:"<br>"}
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
{sectionelse}
|
|
|
|
<table cellpadding='0' cellspacing='0' style="width:100%;">
|
|
<tr>
|
|
<td class='result' style="text-align:left;">
|
|
<!--<img src='./images/icons/bulb22.gif' border='0' class='icon' />-->
|
|
{lang_sprintf id=1500023 1=$owner->user_displayname 2=$url->url_create("profile", $owner->user_info.user_username)}
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
{/section}
|
|
|
|
|
|
{* STUFF TO SHOW IF ONLY ONE BLOG ENTRY *}
|
|
{if $blogentry_id && $total_blogentries==1}
|
|
|
|
<div class='seBlogComments'>
|
|
|
|
{* RETURN AND REPORT LINKS AND SOCIAL BOOKMARKING *}
|
|
<table cellpadding='0' cellspacing='0' border="0" width="100%"><tr><td valign="top">
|
|
|
|
<div style='margin-bottom: 20px;'>
|
|
<div class='button' style='float: left;'>
|
|
<a href='{$url->url_create("blog", $owner->user_info.user_username)}'><!--<img src='./images/icons/back16.gif' border='0' class='button'>-->{lang_sprintf id=1500024 1=$owner->user_displayname}</a>
|
|
</div>
|
|
<div class='button' style='float: left; padding-left: 20px;'>
|
|
<a href="javascript:TB_show(SocialEngine.Language.Translate(861), 'user_report.php?return_url={$url->url_current()|escape:url}&TB_iframe=true&height=300&width=450', '', './images/trans.gif');"><!--<img src='./images/icons/report16.gif' border='0' class='button'>-->{lang_print id=861}</a>
|
|
</div>
|
|
<div style='clear: both; height: 0px;'></div>
|
|
</div>
|
|
|
|
</td><td align="right" valign="top">
|
|
|
|
<div>
|
|
<a rel="nofollow" target="_blank" href="http://delicious.com/save?v=5&noui&jump=close&url={$url->url_create('blog_entry', $owner->user_info.user_username, $blogentry_info.blogentry_id)|escape:url}&title={$blogentry_info.blogentry_title|escape:url}"><!--<img src="./images/icons/socialbookmarking_delicious16.gif" border="0" alt="Delicious" />--></a>
|
|
<a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&media=news&url={$url->url_create('blog_entry', $owner->user_info.user_username, $blogentry_info.blogentry_id)|escape:url}&title={$blogentry_info.blogentry_title|escape:url}"><!--<img src="./images/icons/socialbookmarking_digg16.gif" border="0" alt="Digg" />--></a>
|
|
<a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u={$url->url_create('blog_entry', $owner->user_info.user_username, $blogentry_info.blogentry_id)|escape:url}&t={$blogentry_info.blogentry_title|escape:url}"><!--<img src="./images/icons/socialbookmarking_facebook16.gif" border="0" alt="Facebook" />--></a>
|
|
<a rel="nofollow" target="_blank" href="http://cgi.fark.com/cgi/fark/farkit.pl?u={$url->url_create('blog_entry', $owner->user_info.user_username, $blogentry_info.blogentry_id)|escape:url}&h={$blogentry_info.blogentry_title|escape:url}"><!--<img src="./images/icons/socialbookmarking_fark16.gif" border="0" alt="Fark" />--></a>
|
|
<a rel="nofollow" target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u={$url->url_create('blog_entry', $owner->user_info.user_username, $blogentry_info.blogentry_id)|escape:url}&t={$blogentry_info.blogentry_title|escape:url}"><!--<img src="./images/icons/socialbookmarking_myspace16.gif" border="0" alt="MySpace" />--></a>
|
|
</div>
|
|
|
|
</td></tr></table>
|
|
|
|
{* COMMENTS *}
|
|
<div style='margin-left: auto; margin-right: auto;'>
|
|
|
|
{* COMMENTS *}
|
|
{if $allowed_to_comment}
|
|
<div id="profile_{$media_info.media_id}_postcomment"><div class="comment_headline">Comments (<span class="tc" id="totalcomments">{$blogentry_info.blogentry_totalcomments|default:0}</span>)</div>
|
|
|
|
<form action="misc_js.php" method="post" target="ajaxframe" onsubmit="updatecount();"><div class="profile_postcomment"><textarea name="comment_body" id="comment_body" cols="25" class="comment_area" style="overflow: hidden; height: 70px;" placeholder="Write Something..."></textarea><div style="margin-top: 5px;">Allowed HTML Tags: b, img, a, br</div><div style="text-align: right; margin-top: 5px;">
|
|
|
|
<input type="submit" id="comment_submit" class="button" value="Post Comment" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<input type="hidden" name="task" value="comment_post"><input type="hidden" name="type" value="blog"><input type="hidden" name="iden" value="blogentry_id"><input type="hidden" name="value" value="{$blogentry_id}"><input type="hidden" name="user" value="{$owner->user_info.user_username}"><input type="hidden" name="tab" value="blogentries"><input type="hidden" name="col" value="blogentry"></div><div id="comment_error" style="color: #FF0000; display: none;"></div></div></form>
|
|
|
|
|
|
</div>{/if}
|
|
<div id="{$owner->user_info.user_username}_profile_comments" style='margin-left: auto; margin-right: auto;'></div>
|
|
|
|
{lang_javascript ids=39,155,175,182,183,184,185,187,784,787,829,830,831,832,833,834,835,854,856,891,1025,1026,1032,1034,1071}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
{lang_javascript ids=39,155,175,182,183,184,185,187,784,787,829,830,831,832,833,834,835,854,856,891,1025,1026,1032,1034,1071}
|
|
|
|
{literal}
|
|
<script type="text/javascript" src="/js/jquery.autogrow-textarea.js"></script>
|
|
<script>
|
|
jQuery(function() {
|
|
jQuery('#comment_body').autogrow();
|
|
});
|
|
jQuery(document).ready(function() {
|
|
|
|
|
|
loadXMLDoc(1);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
<script type="text/javascript" src="/js/jquery.autogrow-textarea.js"></script>
|
|
<script>
|
|
function subtractcount(){
|
|
total=document.getElementById('totalcomments').innerHTML;
|
|
total=total*1;
|
|
document.getElementById('totalcomments').innerHTML=total-1;}
|
|
function updatecount()
|
|
{
|
|
if(document.getElementById('comment_body').value!=""){
|
|
total=document.getElementById('totalcomments').innerHTML;
|
|
total=total*1;
|
|
document.getElementById('totalcomments').innerHTML=total+1;
|
|
}
|
|
}
|
|
function loadXMLDoc(page)
|
|
{
|
|
var xmlhttp;
|
|
|
|
if (window.XMLHttpRequest)
|
|
{// code for IE7+, Firefox, Chrome, Opera, Safari
|
|
xmlhttp=new XMLHttpRequest();
|
|
}
|
|
else
|
|
{// code for IE6, IE5
|
|
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
|
|
}
|
|
xmlhttp.onreadystatechange=function()
|
|
{
|
|
|
|
if (xmlhttp.readyState==4 && xmlhttp.status==200)
|
|
{
|
|
|
|
|
|
document.getElementById("{/literal}{$owner->user_info.user_username}_profile_comments{literal}").innerHTML=xmlhttp.responseText;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
xmlhttp.open("GET","{/literal}grabprofilecomments.php?user={$owner->user_info.user_username}&url={$smarty.server.PHP_SELF}{if $smarty.server.QUERY_STRING!=""}?{$smarty.server.QUERY_STRING|urlencode}{/if}&p="+page+"&type=blog&tab=blogentries&col=blogentry&focus=blogentry_id&blogentry_id={$blogentry_id}{literal}",true);
|
|
|
|
|
|
xmlhttp.send();
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
<script type="text/javascript">
|
|
var media_id = 0;
|
|
|
|
jQuery('#ajaxframe').load(function(){
|
|
loadXMLDoc(1);
|
|
|
|
document.getElementById('comment_body').value="";
|
|
});
|
|
|
|
|
|
function lepconfirmprofDelete(id) {
|
|
|
|
media_id = id;
|
|
document.getElementById('del_comment_id1').value=id;
|
|
|
|
TB_show('Delete Comment', '#TB_inline?height=150&width=300&inlineId=confirmdelete1', '', '../images/trans.gif');
|
|
|
|
document.getElementById('del_comment_id1').value=id;
|
|
|
|
}
|
|
function lepremovecomment()
|
|
{
|
|
id=document.getElementById('del_comment_id1').value;
|
|
document.getElementById('comment_'+id).style.display='none';
|
|
}
|
|
|
|
function editComment1(commentID)
|
|
{
|
|
|
|
|
|
|
|
|
|
//var commentContainerElement = $(this.options.type + '_' + this.options.typeID + '_comments');
|
|
//var commentElement = commentContainerElement.getElement('profile_comment_body_' + commentID);
|
|
var commentElement = $('profile_comment_body_' + commentID);
|
|
|
|
var height = commentElement.offsetHeight + 10;
|
|
var commentText = commentElement.innerHTML.replace(/<br>/gi, '\r\n').replace(/>/gi, '>');
|
|
|
|
var innerHTML = '';
|
|
innerHTML += "<form action='misc_js.php' method='post' target='ajaxframe' name='editCommentForm' id='editCommentForm'>";
|
|
innerHTML += "<textarea name='comment_edit' id='comment_edit_" + commentID + "' style='height: " + height +" px; width: 100%;' onblur='doCommentEdit("+commentID+")'>" + commentText + "</textarea>";
|
|
innerHTML += "<input type='hidden' name='task' value='comment_edit'>";
|
|
innerHTML += "<input type='hidden' name='comment_id' value='" + commentID + "'>";
|
|
|
|
innerHTML += "<input type='hidden' name='type' value='blog'>";
|
|
innerHTML += "<input type='hidden' name='iden' value='blogentry_id'>";
|
|
innerHTML += "<input type='hidden' name='value' value='{/literal}{$blogentry_id}{literal}'>";
|
|
|
|
innerHTML +=
|
|
'<input type="hidden" name="tab" value="users">';
|
|
|
|
innerHTML +=
|
|
'<input type="hidden" name="col" value="user">';
|
|
|
|
/* if( this.options.typeTabParent ) innerHTML +=
|
|
'<input type="hidden" name="tab_parent" value="' + this.options.typeTabParent + '">';
|
|
|
|
if( this.options.typeColParent ) innerHTML +=
|
|
'<input type="hidden" name="col_parent" value="' + this.options.typeColParent + '">';
|
|
|
|
if( this.options.typeChild ) innerHTML +=
|
|
'<input type="hidden" name="child" value="1">';
|
|
*/
|
|
|
|
innerHTML += "</form>";
|
|
|
|
|
|
// Inject
|
|
commentElement.innerHTML = innerHTML;
|
|
textarea_autogrow('comment_edit_' + commentID);
|
|
$('comment_edit_' + commentID).focus();
|
|
|
|
|
|
|
|
}
|
|
|
|
function doCommentEdit(commentid)
|
|
{
|
|
//var event = new Event(e);
|
|
|
|
document.getElementById("editCommentForm").submit();
|
|
|
|
commentElement = $('profile_comment_body_' + commentid);
|
|
commentElement.innerHTML=document.getElementById("comment_edit_" + commentid).value;
|
|
|
|
|
|
// stop form submission
|
|
//event.stop();
|
|
}
|
|
|
|
|
|
</script>
|
|
{/literal}
|
|
|
|
|
|
|
|
{* TRACKBACKS *}
|
|
{if !empty($trackback_list)}
|
|
<h2>{lang_print id=1500025}</h2>
|
|
<ul class="seBlogTrackbackList">
|
|
{section name=trackback_loop loop=$trackback_list}
|
|
|
|
<li style="margin-top: 10px; margin-bottom: 20px;">
|
|
<div style="overflow: hidden;">
|
|
<div class="profile_comment_author">
|
|
<a href="{$trackback_list[trackback_loop].blogtrackback_url}">
|
|
<b>{$trackback_list[trackback_loop].blogtrackback_name}</b>
|
|
</a>
|
|
<a href="{$trackback_list[trackback_loop].blogtrackback_url}">
|
|
{$trackback_list[trackback_loop].blogtrackback_title}
|
|
</a>
|
|
</div>
|
|
<div class="profile_comment_date">
|
|
{$datetime->cdate("`$setting.setting_dateformat`", $datetime->timezone("`$trackback_list[trackback_loop].blogtrackback_date`", $global_timezone))}
|
|
</div>
|
|
<div class="profile_comment_body" id="profile_comment_body_{$trackback_list[trackback_loop].blogtrackback_id}">
|
|
{$trackback_list[trackback_loop].blogtrackback_excerpt}
|
|
</div>
|
|
<div class="profile_comment_links">
|
|
<a class="commentDeleteLink" href="javascript:void(0);">
|
|
{lang_print id=155}
|
|
</a>
|
|
|
|
|
<a class="commentReportLink" href="javascript:void(0);" onclick="javascript:TB_show(SocialEngine.Language.Translate(861), 'user_report.php?return_url={$url->url_current()}&TB_iframe=true&height=300&width=450', '', './images/trans.gif');">
|
|
{lang_print id=1500026}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
|
|
{/section}
|
|
</ul>
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
|
|
{* SIDEBAR *}
|
|
</td>
|
|
<td class="seBlogColumnRight" valign="top">
|
|
|
|
<div class="seBlogColumnRightPadding">
|
|
|
|
<div>
|
|
{* USER PHOTO AND DISPLAY NAME *}
|
|
<div style="display:block;width:100%;text-align:center;">
|
|
<a href="{$url->url_create('profile', $owner->user_info.user_username)}"><img class='photo' src='{$owner->user_photo("./images/nophoto.png")}' border='0' width="{$misc->photo_size($owner->user_photo('./images/nophoto.png'),'240','240','w')}" /></a>
|
|
</div>
|
|
<div style="display:block;text-align:center;width:100%;font-weight: bold;margin-top:3px;">
|
|
<a href="{$url->url_create('profile', $owner->user_info.user_username)}">{$owner->user_displayname}</a>
|
|
</div>
|
|
|
|
{* LINKS *}
|
|
<div style='margin: 10px 0px 10px 0px;'>
|
|
<div><a href="{$url->url_create('blog', $owner->user_info.user_username)}">{lang_print id=1500121}</a></div>
|
|
{if $user->user_exists && $user->user_info.user_id!=$owner->user_info.user_id}
|
|
<div class="seBlogSubscribe" {if $is_subscribed} style="display:none;"{/if}><a href="javascript:void(0);" onclick="SocialEngine.Blog.subscribeBlog(SocialEngine.Owner.user_info.user_id);">{lang_print id=1500027}</a></div>
|
|
<div class="seBlogUnsubscribe"{if !$is_subscribed} style="display:none;"{/if}><a href="javascript:void(0);" onclick="SocialEngine.Blog.unsubscribeBlog(SocialEngine.Owner.user_info.user_id);">{lang_print id=1500028}</a></div>
|
|
{/if}
|
|
{if $user->user_info.user_id==$owner->user_info.user_id}
|
|
<div><a href="user_blog.php">{lang_print id=1500055}</a></div>
|
|
{if $blogentry_id && $total_blogentries==1}
|
|
<div><a href="user_blog_entry.php?blogentry_id={$blogentry_id}">{lang_print id=1500170}</a></div>
|
|
{/if}
|
|
{/if}
|
|
</div>
|
|
|
|
{* SEARCH *}
|
|
<div style='margin-bottom: 10px;'>
|
|
<form method="post" action="{$url->url_create('blog', $owner->user_info.user_username)}">
|
|
<table cellpadding='0' cellspacing='0'><tr><td>
|
|
<input type="text" name="blog_search" value="{$blog_search}" />
|
|
</td><td>
|
|
<input class="button" type="submit" value="Search" />
|
|
</td></tr></table>
|
|
</form>
|
|
</div>
|
|
|
|
{* ARCHIVE *}
|
|
{if !empty($archive_list)}
|
|
<div class='blog_archive'>{lang_print id=1500029}</div>
|
|
<ul class="seBlogArchiveList">
|
|
{foreach from=$archive_list item=archive}
|
|
<li>
|
|
<a href="{$url->url_create('blog', $owner->user_info.user_username)}&date_start={$archive.date_start}&date_end={$archive.date_end}">
|
|
{$archive.label}
|
|
</a>
|
|
({$archive.count})
|
|
</li>
|
|
{/foreach}
|
|
</ul>
|
|
{/if}
|
|
|
|
{* CATEGORIES *}
|
|
{if !empty($category_list)}
|
|
<div class='blog_archive'>{lang_print id=1500030}</div>
|
|
<ul class="seBlogCategoryList">
|
|
{foreach from=$category_list item=category}
|
|
<li>
|
|
<a href="{$url->url_create('blog', $owner->user_info.user_username)}&category_id={$category.blogentrycat_id}">
|
|
{if !empty($category.blogentrycat_languagevar_id)}{capture assign=blogentrycat_title}{lang_print id=$category.blogentrycat_languagevar_id}{/capture}{else}{assign var=blogentrycat_title value=$category.blogentrycat_title}{/if}
|
|
{$blogentrycat_title|truncate:25}
|
|
</a>
|
|
({$category.blogentry_count})
|
|
</li>
|
|
{/foreach}
|
|
</ul>
|
|
{/if}
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br />
|
|
|
|
{* DISPLAY PAGINATION MENU IF APPLICABLE *}
|
|
{if $maxpage > 1}
|
|
|
|
<div class='center'>
|
|
{if $p != 1}
|
|
<a href='{$url->url_create("blog", $owner->user_info.user_username)}&p={math equation="p-1" p=$p}'>« {lang_print id=182}</a>
|
|
{else}
|
|
<font class='disabled'>« {lang_print id=182}</font>
|
|
{/if}
|
|
{if $p_start == $p_end}
|
|
| {lang_sprintf id=184 1=$p_start 2=$total_blogentries} |
|
|
{else}
|
|
| {lang_sprintf id=185 1=$p_start 2=$p_end 3=$total_blogentries} |
|
|
{/if}
|
|
{if $p != $maxpage}
|
|
<a href='{$url->url_create("blog", $owner->user_info.user_username)}&p={math equation="p+1" p=$p}'>{lang_print id=183} »</a>
|
|
{else}
|
|
<font class='disabled'>{lang_print id=183} »</font>
|
|
{/if}
|
|
</div>
|
|
{/if}
|
|
|
|
|
|
{include file='footer.tpl'}
|