325 lines
13 KiB
Smarty
325 lines
13 KiB
Smarty
{include file='header.tpl'}
|
|
|
|
{* $Id: user_blog_entry.tpl 161 2009-04-28 21:14:59Z john $ *}
|
|
|
|
<script type="text/javascript" src="./include/js/class_blog.js"></script>
|
|
<script src="/include/ckeditor/ckeditor.js"></script>
|
|
|
|
<table cellpadding='0' cellspacing='0' width='100%'>
|
|
<tr>
|
|
<td valign='top'>
|
|
<!--<img src='./images/icons/blog_blog48.gif' border='0' class='icon_big' style="margin-bottom: 15px;">-->
|
|
<div class='page_header'><span style="font-size:20pt; font-weight:bold;text-transform:uppercase;">{if !empty($blogentry_info.blogentry_id)}Compose Blog{else}{lang_print id=1500053}{/if}</span></div>
|
|
|
|
</td>
|
|
<td valign='top' align='right'>
|
|
<table cellpadding='0' cellspacing='0' width='130'>
|
|
<tr><td class='button' nowrap='nowrap'><a href='user_blog.php'><!--<img src='./images/icons/back16.gif' border='0' class='button'>-->{lang_print id=1500055}</a></td></tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
{* JAVASCRIPT *}
|
|
{lang_javascript ids=1500067,1500122,1500123}
|
|
{literal}
|
|
<script type='text/javascript'>
|
|
<!--
|
|
|
|
SocialEngine.Blog = new SocialEngineAPI.Blog();
|
|
SocialEngine.RegisterModule(SocialEngine.Blog);
|
|
|
|
// -->
|
|
</script>
|
|
{/literal}
|
|
|
|
|
|
{* BLOG ENTRY INPUT *}
|
|
<div id="entry_main">
|
|
|
|
<form action='user_blog_entry.php' method='post' name='blogform' id="blogform">
|
|
<div>{lang_print id=1500056}</div>
|
|
<div><input type='text' name='blogentry_title' class='form-control' size='50' maxlength='100'{if !empty($blogentry_info.blogentry_title)} value='{$blogentry_info.blogentry_title}'{/if} /></div><br>
|
|
|
|
|
|
{* SHOW BLOG CATEGORIES *}
|
|
{if $user->level_info.level_blog_category_create || $blogentrycats|@count>0}
|
|
<div>{lang_print id=1500057}</div><div>
|
|
<table cellpadding='0' cellspacing='0'>
|
|
<tr>
|
|
<td>
|
|
<select name='blogentry_blogentrycat_id' class="form-control" onchange="$('new_blogentrycat_title').style.display = ( this.value==-1 ? '' : 'none' );">
|
|
<option value='0'></option>
|
|
{section name=blogentrycat_loop loop=$blogentrycats}
|
|
<option value='{$blogentrycats[blogentrycat_loop].blogentrycat_id}'{if !empty($blogentry_info.blogentry_blogentrycat_id) && $blogentry_info.blogentry_blogentrycat_id==$blogentrycats[blogentrycat_loop].blogentrycat_id} SELECTED{/if}>
|
|
{if !empty($blogentrycats[blogentrycat_loop].blogentrycat_languagevar_id)}
|
|
{capture assign=blogentrycat_title}{lang_print id=$blogentrycats[blogentrycat_loop].blogentrycat_languagevar_id}{/capture}
|
|
{else}
|
|
{assign var=blogentrycat_title value=$blogentrycats[blogentrycat_loop].blogentrycat_title}
|
|
{/if}
|
|
{$blogentrycat_title|truncate:61}
|
|
</option>
|
|
{/section}
|
|
{if $user->level_info.level_blog_category_create}<option value='-1'>{lang_print id=1500128}</option>{/if}
|
|
</select>
|
|
</td>
|
|
<td>
|
|
<input type="text" id="new_blogentrycat_title" class="form-control" name="new_blogentrycat_title" style="display:none;" />
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div><br>
|
|
|
|
{/if}
|
|
|
|
{* SHOW COMMENTS LINK IF ANY HAVE BEEN POSTED *}
|
|
{if !empty($comments_total)}
|
|
<div>
|
|
{lang_print id=1500017}
|
|
</div><div>
|
|
{lang_sprintf id=1500058 1=$comments_total 2=$url->url_create("blog_entry", $user->user_info.user_username, $blogentry_info.blogentry_id)}
|
|
</div><br>
|
|
|
|
{/if}
|
|
|
|
<br />
|
|
|
|
<textarea name='blogentry_body' rows='40' class='template'>{if !empty($blogentry_info.blogentry_body)}{$blogentry_info.blogentry_body}{/if}</textarea>
|
|
{literal}
|
|
<script>
|
|
//CKFinder.setupCKEditor( );
|
|
// This call can be placed at any point after the
|
|
// <textarea>, or inside a <head><script> in a
|
|
// window.onload event handler.
|
|
|
|
// Replace the <textarea id="editor"> with an CKEditor
|
|
// instance, using default configurations.
|
|
var editor = CKEDITOR.replace( 'blogentry_body',{
|
|
toolbarGroups : [
|
|
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
|
|
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] },
|
|
{ name: 'forms', groups: [ 'forms' ] },
|
|
'/',
|
|
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
|
|
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] },
|
|
{ name: 'links', groups: [ 'links' ] },
|
|
{ name: 'insert', groups: [ 'insert' ] },
|
|
'/',
|
|
{ name: 'styles', groups: [ 'styles' ] },
|
|
{ name: 'colors', groups: [ 'colors' ] },
|
|
{ name: 'tools', groups: [ 'tools' ] },
|
|
{ name: 'others', groups: [ 'others' ] },
|
|
{ name: 'about', groups: [ 'about' ] },
|
|
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] }
|
|
],
|
|
|
|
removeButtons : 'Save,NewPage,ExportPdf,Preview,Print,Templates,About,ImageButton,HiddenField,Button,Select,Textarea,TextField,Radio,Checkbox,Form,Language,BidiRtl,BidiLtr,CreateDiv,Blockquote,Flash,PageBreak,Iframe,Source,Image'
|
|
});
|
|
|
|
config.removeButtons = 'Underline,JustifyCenter';
|
|
//config.replace( 'blogentry_body' );
|
|
</script>
|
|
|
|
|
|
|
|
{/literal}
|
|
|
|
|
|
|
|
|
|
|
|
{* SHOW SETTINGS LINK IF NECESSARY *}
|
|
<table cellpadding='0' cellspacing='0' width='100%'>
|
|
<tr>
|
|
<td class='blog_options'>
|
|
<div id='settings_privacy_show'>
|
|
<a href="javascript:void(0);" onclick="jQuery('#settings_privacy').slideDown();jQuery('#settings_privacy_hide').show();jQuery('#settings_privacy_show').hide();">{lang_print id=1500059}</a>
|
|
</div>
|
|
<div id='settings_privacy_hide' style='display: none;'>
|
|
<a href="javascript:void(0);" onclick="jQuery('#settings_privacy').slideUp();jQuery('#settings_privacy_hide').hide();jQuery('#settings_privacy_show').show();">{lang_print id=1500060}</a>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
|
|
<div id='settings_privacy' class='blog_settings' style='display: none;'>
|
|
|
|
{* SHOW SEARCH PRIVACY OPTIONS IF ALLOWED BY ADMIN *}
|
|
{if $user->level_info.level_blog_search == 1}
|
|
<b>{lang_print id=1500061}</b>
|
|
<table cellpadding='0' cellspacing='0'>
|
|
<tr>
|
|
<td><input type='radio' name='blogentry_search' id='blogentry_search_1' value='1' {if !isset($blogentry_info.blogentry_search) || $blogentry_info.blogentry_search}checked='checked'{/if} /></td>
|
|
<td><label for='blogentry_search_1'>{lang_print id=1500062}</label></td>
|
|
</tr>
|
|
<tr>
|
|
<td><input type='radio' name='blogentry_search' id='blogentry_search_0' value='0' {if isset($blogentry_info.blogentry_search) && !$blogentry_info.blogentry_search}checked='checked'{/if} /></td>
|
|
<td><label for='blogentry_search_0'>{lang_print id=1500063}</label></td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
{/if}
|
|
|
|
{* SHOW PRIVACY OPTIONS *}
|
|
{if $privacy_options|@count > 1}
|
|
<b>{lang_print id=1500132}</b>
|
|
<table cellpadding='0' cellspacing='0'>
|
|
{foreach from=$privacy_options key=k item=v name=privacy_loop}
|
|
<tr>
|
|
<td><input type='radio' name='blogentry_privacy' id='privacy_{$k}' value='{$k}'{if (isset($blogentry_info.blogentry_privacy) && $k==$blogentry_info.blogentry_privacy) || (!isset($blogentry_info.blogentry_privacy) && $smarty.foreach.privacy_loop.first)} checked='checked'{/if} /></td>
|
|
<td><label for='privacy_{$k}'>{lang_print id=$v}</label></td>
|
|
</tr>
|
|
{/foreach}
|
|
</table>
|
|
<br />
|
|
{/if}
|
|
|
|
{* SHOW COMMENT OPTIONS *}
|
|
{if $comment_options|@count > 1}
|
|
<b>{lang_print id=1500133}</b>
|
|
<table cellpadding='0' cellspacing='0'>
|
|
{foreach from=$comment_options key=k item=v name=comment_loop}
|
|
<tr>
|
|
<td><input type='radio' name='blogentry_comments' id='comments_{$k}' value='{$k}'{if (isset($blogentry_info.blogentry_comments) && $k==$blogentry_info.blogentry_comments) || (!isset($blogentry_info.blogentry_comments) && $smarty.foreach.comment_loop.first)} checked='checked'{/if} /></td>
|
|
<td><label for='comments_{$k}'>{lang_print id=$v}</label></td>
|
|
</tr>
|
|
{/foreach}
|
|
</table>
|
|
<br />
|
|
{/if}
|
|
{if $blogentry_info.blogentry_id>0}
|
|
|
|
{else}
|
|
<input type='hidden' name='publishnow' id='publishnow' value='1' />
|
|
<span id="editlink">Publish Immediately <a href="javascript:void(0)" onclick="jQuery('#publishedon').slideDown();jQuery('#editlink').html('Publish On:'); jQuery('#publishnow').val('0'); jQuery('#task').val('savedraft');">Edit</a></span>
|
|
<div class="hidden" id="publishedon">
|
|
Times listed are MST<br />
|
|
|
|
<select name="month"><option {php} if(date("F")=="January"){echo 'selected="selected"';}{/php}>January</option>
|
|
<option {php} if(date("F")=="February"){echo 'selected="selected"';}{/php}>February</option>
|
|
<option {php} if(date("F")=="March"){echo 'selected="selected"';}{/php}>March</option>
|
|
<option {php} if(date("F")=="April"){echo 'selected="selected"';}{/php}>April</option>
|
|
<option {php} if(date("F")=="May"){echo 'selected="selected"';}{/php}>May</option>
|
|
<option {php} if(date("F")=="June"){echo 'selected="selected"';}{/php}>June</option>
|
|
<option {php} if(date("F")=="July"){echo 'selected="selected"';}{/php}>July</option>
|
|
<option {php} if(date("F")=="August"){echo 'selected="selected"';}{/php}>August</option>
|
|
<option {php} if(date("F")=="September"){echo 'selected="selected"';}{/php}>September</option>
|
|
<option {php} if(date("F")=="October"){echo 'selected="selected"';}{/php}>October</option>
|
|
<option {php} if(date("F")=="November"){echo 'selected="selected"';}{/php}>November</option>
|
|
<option {php} if(date("F")=="December"){echo 'selected="selected"';}{/php}>December</option></select>
|
|
<select name="day">
|
|
|
|
{php}
|
|
for($x=1; $x<32; $x++)
|
|
{
|
|
echo "<option";
|
|
if($x==date("j")){echo ' selected="selected"';}
|
|
echo ">".$x."</option>";
|
|
}
|
|
{/php}
|
|
</select>,
|
|
<select name="year">
|
|
|
|
{php}
|
|
for($x=date("Y"); $x<date("Y")+5; $x++)
|
|
{
|
|
echo "<option";
|
|
if($x==date("Y")){echo ' selected="selected"';}
|
|
echo ">".$x."</option>";
|
|
}
|
|
{/php}
|
|
</select>@
|
|
<select name="hour">{php}
|
|
for($x=0; $x<24; $x++)
|
|
{
|
|
echo "<option";
|
|
if($x==date("G")){echo ' selected="selected"';}
|
|
echo ">";
|
|
if($x<10){echo 0;}
|
|
echo $x."</option>";
|
|
}
|
|
{/php}</select>
|
|
<select name="minute">
|
|
{php}
|
|
for($x=0; $x<60; $x++)
|
|
{
|
|
echo "<option";
|
|
if($x==date("i")){echo ' selected="selected"';}
|
|
echo ">";
|
|
if($x<10){echo 0;}
|
|
echo $x."</option>";
|
|
}
|
|
{/php}
|
|
</select>
|
|
<a href="javascript:void(0)" onclick="jQuery('#publishedon').slideUp();puttextback();jQuery('#publishnow').val('1');jQuery('#task').val('dosave');">Cancel</a></div>
|
|
<div class="clear"></div><br />
|
|
{/if}
|
|
{* TRACKBACKS *}<div style="display:none;">
|
|
<b>{lang_print id=1500064}</b>
|
|
<div>{lang_print id=1500126}</div>
|
|
<table cellpadding='0' cellspacing='0'>
|
|
<tr>
|
|
<td>
|
|
<textarea name="blogentry_trackbacks" style="width: 400px;">{if !empty($blogentry_info.blogentry_trackbacks)}{$blogentry_info.blogentry_trackbacks}{/if}</textarea>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<br />
|
|
|
|
|
|
|
|
{* SEND ID FOR EDITING *}
|
|
{if !empty($blogentry_info.blogentry_id)}
|
|
<input type='hidden' name='blogentry_id' value='{$blogentry_info.blogentry_id}' />
|
|
{/if}
|
|
|
|
|
|
|
|
<table cellpadding='3' cellspacing='0'>
|
|
<tr>
|
|
<td>
|
|
{lang_block id=1500065 var=langBlockTemp}<input type='submit' name="publishblog" class='button' value='Publish'>{/lang_block}
|
|
<input type='hidden' name='task' id='task' value='dosave'>
|
|
|
|
</td>
|
|
{if $blogentry_info.blogentry_id==0}
|
|
<td>
|
|
{lang_block id=1500065 var=langBlockTemp}<input type='button' class='button' value='Save Draft' onclick="jQuery('#task').val('savedraft');jQuery('#blogform').submit();">{/lang_block}
|
|
|
|
</form>
|
|
</td>{/if}
|
|
<td>
|
|
{lang_block id=1500066 var=langBlockTemp}<input type='button' class='button' value='{$langBlockTemp}' onClick="SocialEngine.Blog.previewBlog(); return false;">{/lang_block}
|
|
</td>
|
|
<td>
|
|
<form action='user_blog.php' method='post'>
|
|
{lang_block id=39 var=langBlockTemp}<input type='submit' class='button' value='{$langBlockTemp}'>{/lang_block}
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{* BLOG ENTRY PREVIEW *}
|
|
|
|
<div id="entry_preview" style='display: none;'>
|
|
<h2>{lang_print id=1500067} (<a href="javascript:void(0)" onClick="closemodal();">{lang_print id=1500068}</a>)</h2>
|
|
<div id='previewpane' style='padding:0px;border:1px dashed #AAAAAA;'></div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
{literal}
|
|
function puttextback()
|
|
{
|
|
jQuery('#editlink').html('Publish Immediately <a href="javascript:void(0)" onclick="jQuery(\'#publishedon\').slideDown();jQuery(\'#editlink\').html(\'Publish On:\'); jQuery(\'#publishnow\').val(\'0\'); jQuery(\'#task\').val(\'savedraft\');">Edit</a>');
|
|
}
|
|
{/literal}
|
|
</script>
|
|
|
|
|
|
{include file='footer.tpl'} |