Skip to content

Commit 356f0c3

Browse files
committed
Added support for posts types
1 parent aea3b72 commit 356f0c3

24 files changed

+445
-95
lines changed

mywords/admin/ajax/ax-posts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function return_error($msg, $token=true, $redirect=''){
9393
}
9494

9595
// Check content
96-
if ($content==''){
96+
if ($content=='' && $format != 'image'){
9797
return_error(__('Content for this post has not been provided!','mywords'), true);
9898
die();
9999
}

mywords/admin/ajax/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<script type="text/javascript">
2+
history.go(-1);
3+
</script>

mywords/css/admin.css

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,9 @@ td.mw_cat_description{
9797
color: #333;
9898
}
9999
div.mw_messages_post{
100-
background: #fbec88;
101-
padding: 5px;
102100
text-align: center;
103-
border: 1px solid #fad42e;
104101
display: none;
105-
-moz-border-radius: 5px;
106-
-khtml-border-radius: 5px;
107-
-webkit-border-radius: 5px;
108-
border-radius: 5px;
109102
margin-bottom: 10px;
110-
color: #363636;
111103
}
112104
div.messages_error{
113105
background: #cd0a0a;

mywords/css/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<script type="text/javascript">
2+
history.go(-1);
3+
</script>

mywords/docs/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<script type="text/javascript">
2+
history.go(-1);
3+
</script>

mywords/events/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<script type="text/javascript">
2+
history.go(-1);
3+
</script>

mywords/images/icons/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<script type="text/javascript">
2+
history.go(-1);
3+
</script>

mywords/include/js/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<script type="text/javascript">
2+
history.go(-1);
3+
</script>

mywords/include/js/posts.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,10 @@ $(document).ready( function($) {
368368
tinyMCE.activeEditor.save();
369369
}
370370

371-
if ($("#content").val()==''){
371+
/*if ($("#content").val()==''){
372372
alert('<?php _e('Add content before to save this post','mywords'); ?>');
373373
return false;
374-
}
374+
}*/
375375

376376
// Serialize all data
377377
var params = $("form#mw-form-posts").serialize();
@@ -388,7 +388,7 @@ $(document).ready( function($) {
388388
$.post('<?php echo XOOPS_URL; ?>/modules/mywords/admin/ajax/ax-posts.php', params, function(data){
389389

390390
if(data['error']!=undefined && data['error']!=''){
391-
$('div#mw-messages-post').addClass('messages_error');
391+
$('div#mw-messages-post').addClass('alert-danger');
392392
$('div#mw-messages-post').html(data['error']);
393393
$('div#mw-messages-post').slideDown();
394394
if(data['token'])

mywords/post.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,6 @@
9595

9696
$xoopsTpl->assign('lang_reads', sprintf(__('%u views','mywords'), $post->getVar('reads')));
9797

98-
// Tags
99-
$tags = $post->tags(true);
100-
$tags_list = '';
101-
foreach($tags as $i => $tag){
102-
$tags_list .= ($tags_list==''?'':', ').'<a href="'.$tag->permalink().'">'.$tag->getVar('tag').'</a>';
103-
}
104-
10598
// Post pages
10699
$total_pages = $post->total_pages();
107100
$nav = new RMPageNav($total_pages, 1, $page, 5);
@@ -115,8 +108,8 @@
115108
'title' => $post->getVar('title'),
116109
'published' => sprintf(__('%s by %s','mywords'), MWFunctions::format_time($post->getVar('pubdate')) . ' ' . date('H:i',$post->getVar('pubdate')),'<a href="'.$editor->permalink().'">'.(isset($editor) ? $editor->getVar('name') : __('Anonymous','mywords'))."</a>"),
117110
'text' => $post->content(false, $page),
118-
'cats' => $post->get_categories_names(),
119-
'tags' => $tags_list,
111+
'cats' => $post->get_categos('data'),
112+
'tags' => $post->tags(false),
120113
'trackback' => $post->getVar('pingstatus') ? MWFunctions::get_url(true).$post->id() : '',
121114
'meta' => $post->get_meta('', false),
122115
'time' => $post->getVar('pubdate'),
@@ -128,9 +121,16 @@
128121
'bio' => $editor->getVar('bio'),
129122
'email' => $editor->data('email')
130123
),
131-
'alink' => $editor->permalink()
124+
'alink' => $editor->permalink(),
125+
'format' => $post->format
132126
);
133127

128+
$xoopsTpl->assign('full_post', 1);
129+
$xoopsTpl->assign('lang_editpost', __('Edit Post','mywords'));
130+
$xoopsTpl->assign('lang_postedin', __('Posted in:','mywords'));
131+
$xoopsTpl->assign('lang_taggedas', __('Tagged as:','mywords'));
132+
$xoopsTpl->assign('enable_images', $xoopsModuleConfig['list_post_imgs']);
133+
134134
// Plugins?
135135
$post_arr = RMEvents::get()->run_event('mywords.view.post', $post_arr, $post);
136136
$xoopsTpl->assign('post', $post_arr);

0 commit comments

Comments
 (0)