Changeset 19048
- Timestamp:
- Nov 16, 2012, 11:33:14 AM (12 years ago)
- Location:
- extensions/Evil_Blog
- Files:
-
- 1 added
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
extensions/Evil_Blog/blog.tpl
r18997 r19048 1 1 {$TITLE} 2 <a href="{$ROOT_URL}/?blog/feed" title="{'Notification'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/RSS.png"></a> 2 3 <ul class="evil_blog_posts"> 3 4 {foreach from=$row item=value} … … 21 22 </ul> 22 23 23 <script type="text/javascript">{literal} 24 function subnum (num) { 25 document.blog_pagination.npage.value=num; 26 document.blog_pagination.submit(); 27 } 28 {/literal} 29 </script> 30 <form name='blog_pagination' action='' method='POST'> 24 {if $pages>1} 31 25 <div class="navigationBar"> 32 <a href="{$first_page}" rel="first">{'First'|@translate}</a> | 33 <a href="#" onclick='subnum({$npage-1})' rel="prev">{'Previous'|@translate}</a> | 34 <input type='text' name='npage' style='visibility: hidden; position: absolute;'> 26 {if $npage!=1} 27 <a href="{$ROOT_URL}?/blog/1" rel="first">{'First'|@translate}</a> | 28 <a href="{$ROOT_URL}?/blog/{$npage-1}" rel="prev">{'Previous'|@translate}</a> | 29 {/if} 35 30 {foreach from=$pagi item=v} 36 31 {if $v!=$npage} 37 <a class='blog_pagination' href= '#' onclick='subnum({$v})'>{$v}</a> |32 <a class='blog_pagination' href="{$ROOT_URL}?/blog/{$v}">{$v}</a> | 38 33 {else} 39 34 <span class='pageNumberSelected'>{$v}</span> | 40 35 {/if} 41 36 {/foreach} 42 <a href="#" onclick='subnum({$npage+1})' rel="next">{'Next'|@translate}</a> | 43 <a href="#" onclick='subnum({$pages})' rel="last">{'Last'|@translate}</a> 37 {if $npage!=$pages} 38 <a href="{$ROOT_URL}?/blog/{$npage+1}" rel="next">{'Next'|@translate}</a> | 39 <a href="{$ROOT_URL}?/blog/{$pages}" rel="last">{'Last'|@translate}</a> 40 {/if} 44 41 </div> 45 </form>42 {/if} 46 43 {$TITLE_END} -
extensions/Evil_Blog/main.inc.php
r18997 r19048 1 1 <?php 2 2 /* 3 Version: 1. 1.23 Version: 1.2.0 4 4 Plugin Name: Evil_Blog 5 5 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=611 … … 53 53 54 54 if (((empty($tokens[0])) and ($page['evil_blog']['show_on_main_page'])) or 55 ((!$page['evil_blog']['show_on_main_page']) and($tokens[0]=='blog'))) {//если дело происходит на главной странице, то... 56 55 ($tokens[0]=='blog')) {//если дело происходит на главной странице, то... 56 //RSS 57 if ((!empty($tokens[1])) and ($tokens[1]=="feed")) { 58 include_once (Evil_Blog_PATH.'feed.php'); 59 } else { 60 57 61 $post_per_page = $page['evil_blog']['posts_per_page']; 58 62 //узнаем количество записей в блоге … … 62 66 $pages = floor($row["COUNT(*)"] / $post_per_page)+1; 63 67 } else {$pages = floor($row["COUNT(*)"] / $post_per_page);} 64 if ((empty($ _POST['npage'])) or ($_POST['npage']<=1)) {68 if ((empty($tokens[1])) or ($tokens[1]<=1)) { 65 69 $number = 0; 66 70 $npage = 1; 67 71 } else { 68 $npage = $ _POST['npage'];72 $npage = $tokens[1]; 69 73 if ($npage<=$pages) { 70 74 $number=($npage-1)*$post_per_page; … … 104 108 } 105 109 //определяем заголовок 106 if ( $page['evil_blog']['show_on_main_page']) {110 if (($page['evil_blog']['show_on_main_page']) and ($tokens[0]!='blog')) { 107 111 $place = 'PLUGIN_INDEX_CONTENT_BEFORE'; 108 112 $template->assign('TITLE', '<div id="content" class="content contentWithMenu"><h2>'.$page['evil_blog']['blog_name'].'</h2>'); 109 113 $template->assign('TITLE_END', '</div>'); 110 $template->assign('first_page', 'index.php');111 114 }else{//хлебные крошки 112 115 $place = 'PLUGIN_INDEX_CONTENT_END'; 113 116 $page['title'] = '<a href="'.get_gallery_home_url().'">'.l10n('Home').'</a>'.$conf['level_separator'].$page['evil_blog']['blog_name']; 114 117 $template->assign('TITLE_END', ' '); 115 $template->assign('first_page', 'index.php?/blog');116 118 } 117 119 //отсылаем в СМАРТИ настройки внешнего вида … … 122 124 //определяем адрес шаблона плагина 123 125 $template->set_template_dir(Evil_Blog_PATH); 124 $template->set_filename(' posts', 'posts.tpl');126 $template->set_filename('blog', 'blog.tpl'); 125 127 //подключение стиля 126 128 $template->func_combine_css(array( … … 130 132 131 133 //объявляем где конкретно на странице должен вывестись наш шаблон плагина. Вся суть в 'PLUGIN_INDEX_CONTENT_BEFORE'. 132 $template->concat($place, $template->parse('posts', true)); 134 $template->concat($place, $template->parse('blog', true)); 135 } 133 136 } 134 137 } … … 163 166 164 167 $eb_conf = @unserialize($conf['evil_blog']); 165 if ( (!$eb_conf['show_on_main_page']) and (($tokens[0]=='blog'))) {168 if ($tokens[0]=='blog') { 166 169 $page['section'] = 'blog'; 167 170 } -
extensions/Evil_Blog/maintain.inc.php
r18997 r19048 19 19 PRIMARY KEY (id)) 20 20 DEFAULT CHARACTER SET utf8'; 21 pwg_query($query.';'); 21 pwg_query($query); 22 }else{ 23 $query = 24 'SHOW FIELDS FROM"' . $prefixeTable . 'evil_blog"'; 25 $result = pwg_query($query); 22 26 } 23 27 … … 62 66 DEFAULT CHARACTER SET utf8'; 63 67 pwg_query($query.';'); 64 } 68 }/*else{ 69 $result = pwg_query("SHOW FIELDS FROM " . $prefixeTable . "evil_blog;"); 70 $description = false; 71 While ($row = pwg_db_fetch_assoc($result)) { 72 if ($row['Field']=='description') {$description=true; break;} 73 } 74 if (!$description) { 75 $result = pwg_query("ALTER TABLE " . $prefixeTable . "evil_blog CHANGE `text` `description` LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;"); 76 $result = pwg_query("ALTER TABLE " . $prefixeTable . "evil_blog ADD `text` LONGTEXT NOT NULL ;"); 77 } 78 }*/ 65 79 66 80 $config = array( … … 91 105 global $prefixeTable; 92 106 pwg_query('DROP TABLE ' . $prefixeTable . 'evil_blog;'); 93 94 $q = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE '.CONFIG_TABLE.'.param="evil_blog" LIMIT 1;'; 95 pwg_query($q); 107 pwg_query('DELETE FROM ' . CONFIG_TABLE . ' WHERE '.CONFIG_TABLE.'.param="evil_blog" LIMIT 1;'); 96 108 unset($conf['evil_blog']); 97 109 }
Note: See TracChangeset
for help on using the changeset viewer.