0.5.1
22
CHANGELOG
Normal file
@ -0,0 +1,22 @@
|
||||
postInfoWidget 0.5.1 - 2015-04-23 - Pierre Van Glabeke
|
||||
* modif url support
|
||||
|
||||
postInfoWidget 0.5 - 2015-01-29 - Pierre Van Glabeke
|
||||
* ajout case hors ligne
|
||||
* modif localisation
|
||||
* fin de ligne unix (LF)
|
||||
|
||||
postInfoWidget 0.4 - 2013-11-12
|
||||
* Switch to Dotclear 2.6
|
||||
* Clean up code
|
||||
* Add widget options
|
||||
|
||||
postInfoWidget 0.3 - 2010-06-21
|
||||
* Fixed tags list
|
||||
* Fixed nav links
|
||||
|
||||
postInfoWidget 0.2 - 2010-06-05
|
||||
* Switched to DC 2.2
|
||||
|
||||
postInfoWidget 0.1 - 2010-05-24
|
||||
* First lab release
|
19
ICONS
Normal file
@ -0,0 +1,19 @@
|
||||
Flags icons
|
||||
|
||||
“Flags” are 247 icons — in GIF and PNG formats — representing most countries in
|
||||
the world as small pixel icons. These flag icons are available for free use for any
|
||||
purpose with no requirement for attribution.
|
||||
Come from http://www.famfamfam.com/lab/icons/flags/
|
||||
|
||||
Fugue Icons
|
||||
|
||||
Copyright (C) 2010 Yusuke Kamiyamane. All rights reserved.
|
||||
The icons are licensed under a Creative Commons Attribution
|
||||
3.0 license. <http://creativecommons.org/licenses/by/3.0/>
|
||||
|
||||
If you can't or don't want to provide a link back, please
|
||||
purchase a royalty-free license. <http://pinvoke.com/>
|
||||
|
||||
I'm unavailable for custom icon design work. But your
|
||||
suggestions are always welcome!
|
||||
<mailto:yusuke.kamiyamane@gmail.com>
|
24
README.md
@ -1,2 +1,22 @@
|
||||
# postInfoWidget
|
||||
Afficher les informations d'un billet dans un widget
|
||||
# README
|
||||
|
||||
## WHAT IS POSTINFOWIDGET ?
|
||||
|
||||
postInfoWidget "Entry information list" is a plugin for the open-source
|
||||
web publishing software called Dotclear.
|
||||
|
||||
Show entry details in a widget.
|
||||
|
||||
## REQUIREMENTS
|
||||
|
||||
postInfoWidget requires:
|
||||
|
||||
* permissions to manage widgets
|
||||
* Dotclear 2.6
|
||||
|
||||
## USAGE
|
||||
|
||||
First install postInfoWidget, manualy from a zip package or from
|
||||
Dotaddict repository. (See Dotclear's documentation to know how do this)
|
||||
|
||||
Add and configure "Entry information list" from widgets manager.
|
||||
|
19
_admin.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
# -- BEGIN LICENSE BLOCK ----------------------------------
|
||||
#
|
||||
# This file is part of postInfoWidget, a plugin for Dotclear 2.
|
||||
#
|
||||
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors
|
||||
#
|
||||
# Licensed under the GPL version 2.0 license.
|
||||
# A copy of this license is available in LICENSE file or at
|
||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
#
|
||||
# -- END LICENSE BLOCK ------------------------------------
|
||||
|
||||
if (!defined('DC_CONTEXT_ADMIN')) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
require dirname(__FILE__).'/_widgets.php';
|
35
_define.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
# -- BEGIN LICENSE BLOCK ----------------------------------
|
||||
#
|
||||
# This file is part of postInfoWidget, a plugin for Dotclear 2.
|
||||
#
|
||||
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors
|
||||
#
|
||||
# Licensed under the GPL version 2.0 license.
|
||||
# A copy of this license is available in LICENSE file or at
|
||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
#
|
||||
# -- END LICENSE BLOCK ------------------------------------
|
||||
|
||||
if (!defined('DC_RC_PATH')) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
$this->registerModule(
|
||||
/* Name */
|
||||
"postInfoWidget",
|
||||
/* Description*/
|
||||
"Show Entry informations on a widget",
|
||||
/* Author */
|
||||
"Jean-Christian Denis, Pierre Van Glabeke",
|
||||
/* Version */
|
||||
'0.5.1',
|
||||
array(
|
||||
'permissions' => 'usage,contentadmin',
|
||||
'type' => 'plugin',
|
||||
'dc_min' => '2.7',
|
||||
'support' => 'http://forum.dotclear.org/viewtopic.php?pid=332974#p332974',
|
||||
'details' => 'http://plugins.dotaddict.org/dc2/details/postInfoWidget'
|
||||
)
|
||||
);
|
19
_public.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
# -- BEGIN LICENSE BLOCK ----------------------------------
|
||||
#
|
||||
# This file is part of postInfoWidget, a plugin for Dotclear 2.
|
||||
#
|
||||
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors
|
||||
#
|
||||
# Licensed under the GPL version 2.0 license.
|
||||
# A copy of this license is available in LICENSE file or at
|
||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
#
|
||||
# -- END LICENSE BLOCK ------------------------------------
|
||||
|
||||
if (!defined('DC_RC_PATH')) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
require dirname(__FILE__).'/_widgets.php';
|
631
_widgets.php
Normal file
@ -0,0 +1,631 @@
|
||||
<?php
|
||||
# -- BEGIN LICENSE BLOCK ----------------------------------
|
||||
#
|
||||
# This file is part of postInfoWidget, a plugin for Dotclear 2.
|
||||
#
|
||||
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors
|
||||
#
|
||||
# Licensed under the GPL version 2.0 license.
|
||||
# A copy of this license is available in LICENSE file or at
|
||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
#
|
||||
# -- END LICENSE BLOCK ------------------------------------
|
||||
|
||||
if (!defined('DC_RC_PATH')) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
$core->addBehavior(
|
||||
'initWidgets',
|
||||
array('postInfoWidget', 'adminWidget')
|
||||
);
|
||||
|
||||
class postInfoWidget
|
||||
{
|
||||
public static function adminWidget($w)
|
||||
{
|
||||
global $core;
|
||||
|
||||
$w->create(
|
||||
'postinfowidget',
|
||||
__('PostInfoWidget: entry information list'),
|
||||
array('postInfoWidget', 'publicWidget'),
|
||||
null,
|
||||
__('Show Entry informations on a widget')
|
||||
);
|
||||
$w->postinfowidget->setting(
|
||||
'title',
|
||||
__('Title:'),
|
||||
__('About this entry'),
|
||||
'text'
|
||||
);
|
||||
$w->postinfowidget->setting(
|
||||
'dt_str',
|
||||
__('Publish date text:'),
|
||||
__('Publish on %Y-%m-%d %H:%M'),
|
||||
'text'
|
||||
);
|
||||
$w->postinfowidget->setting(
|
||||
'creadt_str',
|
||||
__('Create date text:'),
|
||||
__('Create on %Y-%m-%d %H:%M'),
|
||||
'text'
|
||||
);
|
||||
$w->postinfowidget->setting(
|
||||
'upddt_str',
|
||||
__('Update date text:'),
|
||||
__('Update on %Y-%m-%d %H:%M'),
|
||||
'text'
|
||||
);
|
||||
$w->postinfowidget->setting(
|
||||
'lang_str',
|
||||
__('Language (%T = name, %C = code, %F = flag):'),
|
||||
__('Language: %T %F'),
|
||||
'text'
|
||||
);
|
||||
$w->postinfowidget->setting(
|
||||
'author_str',
|
||||
__('Author text (%T = author):'),
|
||||
__('Author: %T'),
|
||||
'text'
|
||||
);
|
||||
$w->postinfowidget->setting(
|
||||
'category_str',
|
||||
__('Category text (%T = category):'),
|
||||
__('Category: %T'),
|
||||
'text'
|
||||
);
|
||||
if ($core->plugins->moduleExists('tags')) {
|
||||
$w->postinfowidget->setting(
|
||||
'tag_str',
|
||||
__('Tags text (%T = tags list):'),
|
||||
__('Tags: %T'),
|
||||
'text'
|
||||
);
|
||||
}
|
||||
$w->postinfowidget->setting(
|
||||
'attachment_str',
|
||||
__('Attachments text (%T = text, %D = numeric):'),
|
||||
__('Attachments: %T'),
|
||||
'text'
|
||||
);
|
||||
$w->postinfowidget->setting(
|
||||
'comment_str',
|
||||
__('Comments text (%T = text, %D = numeric):'),
|
||||
__('Comments: %T'),
|
||||
'text'
|
||||
);
|
||||
$w->postinfowidget->setting(
|
||||
'trackback_str',
|
||||
__('Trackbacks text (%T = text, %D = numeric):'),
|
||||
__('Trackbacks: %T'),
|
||||
'text'
|
||||
);
|
||||
$w->postinfowidget->setting(
|
||||
'permalink_str',
|
||||
__('Permalink text (%T = text link, %F = full link):'),
|
||||
__('%T'),
|
||||
'text'
|
||||
);
|
||||
$w->postinfowidget->setting(
|
||||
'feed',
|
||||
__('Show comment feed url'),
|
||||
1,
|
||||
'check'
|
||||
);
|
||||
$w->postinfowidget->setting(
|
||||
'navprevpost',
|
||||
__('Link to previous entry (%T = navigation text, %F = entry title):'),
|
||||
__('%T'),
|
||||
'text'
|
||||
);
|
||||
$w->postinfowidget->setting(
|
||||
'navnextpost',
|
||||
__('Link to next entry (%T = navigation text, %F = entry title):'),
|
||||
__('%T'),
|
||||
'text'
|
||||
);
|
||||
$w->postinfowidget->setting(
|
||||
'navprevcat',
|
||||
__('Link to previous entry of this category (%T = navigation text, %F = entry title):'),
|
||||
__('%T'),
|
||||
'text'
|
||||
);
|
||||
$w->postinfowidget->setting(
|
||||
'navnextcat',
|
||||
__('Link to next entry of this category (%T = navigation text, %F = entry title):'),
|
||||
__('%T'),
|
||||
'text'
|
||||
);
|
||||
$w->postinfowidget->setting(
|
||||
'style',
|
||||
__('Try to adapt style'),
|
||||
'small',
|
||||
'combo',
|
||||
array(
|
||||
__('No style') => '-',
|
||||
__('Small icon') => 'small',
|
||||
__('Normal icon') => 'normal'
|
||||
)
|
||||
);
|
||||
$w->postinfowidget->setting(
|
||||
'rmvinfo',
|
||||
__('Try to remove entry information'),
|
||||
1,
|
||||
'check'
|
||||
);
|
||||
$w->postinfowidget->setting(
|
||||
'rmvtags',
|
||||
__('Try to remove entry tags'),
|
||||
1,
|
||||
'check'
|
||||
);
|
||||
$w->postinfowidget->setting(
|
||||
'rmvnav',
|
||||
__('Try to remove entry navigation'),
|
||||
1,
|
||||
'check'
|
||||
);
|
||||
|
||||
# --BEHAVIOR-- postInfoWidgetAdmin
|
||||
$core->callBehavior('postInfoWidgetAdmin', $w);
|
||||
|
||||
$w->postinfowidget->setting(
|
||||
'content_only',
|
||||
__('Content only'),
|
||||
0,
|
||||
'check'
|
||||
);
|
||||
|
||||
$w->postinfowidget->setting(
|
||||
'class',
|
||||
__('CSS class:'),
|
||||
''
|
||||
);
|
||||
$w->postinfowidget->setting('offline',__('Offline'),0,'check');
|
||||
}
|
||||
|
||||
public static function publicWidget($w)
|
||||
{
|
||||
global $core, $_ctx;
|
||||
|
||||
if ($w->offline)
|
||||
return;
|
||||
|
||||
if ($core->url->type != 'post'
|
||||
|| !$_ctx->posts->post_id
|
||||
){
|
||||
return null;
|
||||
}
|
||||
|
||||
$link = '<a href="%s">%s</a>';
|
||||
$title = (strlen($w->title) > 0) ?
|
||||
'<h2>'.html::escapeHTML($w->title).'</h2>' : null;
|
||||
$content = '';
|
||||
|
||||
if ($w->dt_str != '') {
|
||||
$content .= postInfoWidget::li(
|
||||
$w,
|
||||
'date',
|
||||
dt::str(
|
||||
$w->dt_str,
|
||||
strtotime($_ctx->posts->post_dt),
|
||||
$core->blog->settings->system->blog_timezone
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ($w->creadt_str != '') {
|
||||
$content .= postInfoWidget::li(
|
||||
$w,
|
||||
'create',
|
||||
dt::str(
|
||||
$w->creadt_str,
|
||||
strtotime($_ctx->posts->post_creadt),
|
||||
$core->blog->settings->system->blog_timezone
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ($w->upddt_str != '') {
|
||||
$content .= postInfoWidget::li(
|
||||
$w,
|
||||
'update',
|
||||
dt::str(
|
||||
$w->upddt_str,
|
||||
strtotime($_ctx->posts->post_upddt),
|
||||
$core->blog->settings->system->blog_timezone
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ($w->lang_str != '') {
|
||||
$ln = l10n::getISOcodes();
|
||||
$lang_code = $_ctx->posts->post_lang ?
|
||||
$_ctx->posts->post_lang :
|
||||
$core->blog->settings->system->lang;
|
||||
$lang_name = isset($ln[$lang_code]) ?
|
||||
$ln[$lang_code] :
|
||||
$lang_code;
|
||||
$lang_flag = file_exists(
|
||||
dirname(__FILE__).
|
||||
'/img/flags/'.
|
||||
$lang_code.'.png'
|
||||
) ?
|
||||
'<img src="'.$core->blog->getQmarkURL().
|
||||
'pf=postInfoWidget/img/flags/'.
|
||||
$lang_code.'.png" alt="'.$lang_name.'" />' :
|
||||
'';
|
||||
|
||||
$content .= postInfoWidget::li(
|
||||
$w,
|
||||
'lang',
|
||||
str_replace(
|
||||
array('%T', '%C', '%F'),
|
||||
array($lang_name, $lang_code, $lang_flag),
|
||||
html::escapeHTML($w->lang_str)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ($w->author_str != '') {
|
||||
$content .= postInfoWidget::li(
|
||||
$w,
|
||||
'author',
|
||||
str_replace(
|
||||
'%T',
|
||||
$_ctx->posts->getAuthorLink(),
|
||||
html::escapeHTML($w->author_str)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ($w->category_str != '' && $_ctx->posts->cat_id) {
|
||||
$content .= postInfoWidget::li(
|
||||
$w,
|
||||
'category',
|
||||
str_replace(
|
||||
'%T',
|
||||
sprintf(
|
||||
$link,
|
||||
$_ctx->posts->getCategoryURL(),
|
||||
html::escapeHTML($_ctx->posts->cat_title)
|
||||
),
|
||||
html::escapeHTML($w->category_str)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ($w->tag_str != '' && $core->plugins->moduleExists('tags')) {
|
||||
$meta = $core->meta->getMetadata(array(
|
||||
'meta_type' => 'tag',
|
||||
'post_id' => $_ctx->posts->post_id
|
||||
));
|
||||
$metas = array();
|
||||
while ($meta->fetch()) {
|
||||
$metas[$meta->meta_id] = sprintf(
|
||||
$link,
|
||||
$core->blog->url.
|
||||
$core->url->getBase('tag')."/".
|
||||
rawurlencode($meta->meta_id),
|
||||
$meta->meta_id
|
||||
);
|
||||
}
|
||||
if (!empty($metas)) {
|
||||
$content .= postInfoWidget::li(
|
||||
$w,
|
||||
'tag',
|
||||
str_replace(
|
||||
'%T',
|
||||
implode(', ', $metas),
|
||||
html::escapeHTML($w->tag_str)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ($w->attachment_str != '') {
|
||||
$nb = $_ctx->posts->countMedia();
|
||||
if ($nb == 0) {
|
||||
$attachment_numeric = 0;
|
||||
$attachment_textual = __('no attachment');
|
||||
}
|
||||
elseif ($nb == 1) {
|
||||
$attachment_numeric = sprintf(
|
||||
$link,
|
||||
'#attachment',
|
||||
1
|
||||
);
|
||||
$attachment_textual = sprintf(
|
||||
$link,
|
||||
'#attachment',
|
||||
__('one attachment')
|
||||
);
|
||||
}
|
||||
else {
|
||||
$attachment_numeric = sprintf(
|
||||
$link,
|
||||
'#attachment',
|
||||
$nb
|
||||
);
|
||||
$attachment_textual = sprintf(
|
||||
$link,
|
||||
'#attachment',
|
||||
sprintf(__('%d attachments'), $nb)
|
||||
);
|
||||
}
|
||||
|
||||
$content .= postInfoWidget::li(
|
||||
$w,
|
||||
'attachment',
|
||||
str_replace(
|
||||
array('%T', '%D'),
|
||||
array($attachment_textual, $attachment_numeric),
|
||||
html::escapeHTML($w->attachment_str)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ($w->comment_str != '' && $_ctx->posts->commentsActive()) {
|
||||
$nb = $_ctx->posts->nb_comment;
|
||||
if ($nb == 0) {
|
||||
$comment_numeric = 0;
|
||||
$comment_textual = __('no comment');
|
||||
}
|
||||
elseif ($nb == 1) {
|
||||
$comment_numeric = sprintf(
|
||||
$link,
|
||||
'#comments',
|
||||
1
|
||||
);
|
||||
$comment_textual = sprintf(
|
||||
$link,
|
||||
'#comments',
|
||||
__('one comment')
|
||||
);
|
||||
}
|
||||
else {
|
||||
$comment_numeric = sprintf(
|
||||
$link,
|
||||
'#comments',
|
||||
$nb
|
||||
);
|
||||
$comment_textual = sprintf(
|
||||
$link,
|
||||
'#comments',
|
||||
sprintf(__('%d comments'), $nb)
|
||||
);
|
||||
}
|
||||
|
||||
$content .= postInfoWidget::li(
|
||||
$w,
|
||||
'comment',
|
||||
str_replace(
|
||||
array('%T', '%D'),
|
||||
array($comment_textual, $comment_numeric),
|
||||
html::escapeHTML($w->comment_str)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ($w->trackback_str != '' && $_ctx->posts->trackbacksActive()) {
|
||||
$nb = $_ctx->posts->nb_trackback;
|
||||
if ($nb == 0) {
|
||||
$trackback_numeric = 0;
|
||||
$trackback_textual = __('no trackback');
|
||||
}
|
||||
elseif ($nb == 1) {
|
||||
$trackback_numeric = sprintf(
|
||||
$link,
|
||||
'#pings',
|
||||
1
|
||||
);
|
||||
$trackback_textual = sprintf(
|
||||
$link,
|
||||
'#pings',
|
||||
__('one trackback')
|
||||
);
|
||||
}
|
||||
else {
|
||||
$trackback_numeric = sprintf(
|
||||
$link,
|
||||
'#pings',
|
||||
$nb
|
||||
);
|
||||
$trackback_textual = sprintf(
|
||||
$link,
|
||||
'#pings',
|
||||
sprintf(__('%d trackbacks'), $nb)
|
||||
);
|
||||
}
|
||||
|
||||
$content .= postInfoWidget::li(
|
||||
$w,
|
||||
'trackback',
|
||||
str_replace(
|
||||
array('%T', '%D'),
|
||||
array($trackback_textual, $trackback_numeric),
|
||||
html::escapeHTML($w->trackback_str)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ($w->permalink_str) {
|
||||
$content .= postInfoWidget::li(
|
||||
$w,
|
||||
'permalink',
|
||||
str_replace(
|
||||
array('%T', '%F'),
|
||||
array(
|
||||
sprintf(
|
||||
$link,
|
||||
$_ctx->posts->getURL(),
|
||||
__('Permalink')),
|
||||
$_ctx->posts->getURL()
|
||||
),
|
||||
html::escapeHTML($w->permalink_str)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ($w->feed && $_ctx->posts->commentsActive()) {
|
||||
$content .= postInfoWidget::li(
|
||||
$w,
|
||||
'feed',
|
||||
sprintf(
|
||||
$link,
|
||||
$core->blog->url.
|
||||
$core->url->getBase('feed').
|
||||
'/atom/comments/'.
|
||||
$_ctx->posts->post_id,
|
||||
__("This post's comments feed"),
|
||||
html::escapeHTML($w->tag_str)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ($w->navprevpost) {
|
||||
$npp = postInfoWidget::nav(
|
||||
$_ctx->posts,
|
||||
-1,
|
||||
false,
|
||||
__('Previous entry'),
|
||||
$w->navprevpost
|
||||
);
|
||||
if ($npp) {
|
||||
$content .= postInfoWidget::li(
|
||||
$w,
|
||||
'previous',
|
||||
$npp
|
||||
);
|
||||
}
|
||||
}
|
||||
if ($w->navnextpost) {
|
||||
$nnp = postInfoWidget::nav(
|
||||
$_ctx->posts,
|
||||
1,
|
||||
false,
|
||||
__('Next entry'),
|
||||
$w->navnextpost
|
||||
);
|
||||
if ($nnp) {
|
||||
$content .= postInfoWidget::li(
|
||||
$w,
|
||||
'next',
|
||||
$nnp
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ($w->navprevcat) {
|
||||
$npc = postInfoWidget::nav(
|
||||
$_ctx->posts,
|
||||
-1,
|
||||
true,
|
||||
__('Previous entry of this category'),
|
||||
$w->navprevcat
|
||||
);
|
||||
if ($npc) {
|
||||
$content .= postInfoWidget::li(
|
||||
$w,
|
||||
'previous',
|
||||
$npc
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ($w->navnextcat) {
|
||||
$nnc = postInfoWidget::nav(
|
||||
$_ctx->posts,
|
||||
1,
|
||||
true,
|
||||
__('Next entry of this category'),
|
||||
$w->navnextcat
|
||||
);
|
||||
if ($nnc) {
|
||||
$content .= postInfoWidget::li(
|
||||
$w,
|
||||
'next',
|
||||
$nnc
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
# --BEHAVIOR-- postInfoWidgetPublic
|
||||
$content .= $core->callBehavior('postInfoWidgetPublic', $w);
|
||||
|
||||
if (empty($content)) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
$rmv = '';
|
||||
if ($w->rmvinfo || $w->rmvtags || $w->rmvnav) {
|
||||
$rmv .=
|
||||
'<script type="text/javascript">'."\n".
|
||||
'$(function() {'."\n";
|
||||
if ($w->rmvinfo) {
|
||||
$rmv .=
|
||||
'var piw_pi=$("#content .post-info");'."\n".
|
||||
'if ($(piw_pi).length!=0){$(piw_pi).hide();}'."\n";
|
||||
}
|
||||
if ($w->rmvtags) {
|
||||
$rmv .=
|
||||
'var piw_pt=$("#content .post-tags");'."\n".
|
||||
'if ($(piw_pt).length!=0){$(piw_pt).hide();}'."\n";
|
||||
}
|
||||
if ($w->rmvnav) {
|
||||
$rmv .=
|
||||
'var piw_pn=$("#content #navlinks");'."\n".
|
||||
'if ($(piw_pn).length!=0){$(piw_pn).hide();}'."\n";
|
||||
}
|
||||
$rmv .=
|
||||
'});'."\n".
|
||||
"</script>\n";
|
||||
}
|
||||
|
||||
$rmv =
|
||||
($w->title ? $w->renderTitle(html::escapeHTML($w->title)) : '').
|
||||
'<ul>'.$content.'</ul>';
|
||||
|
||||
return $w->renderDiv($w->content_only,'postinfowidget '.$w->class,'',$rmv);
|
||||
}
|
||||
|
||||
public static function li($w, $i, $c)
|
||||
{
|
||||
$s = ' style="padding-left:%spx;background: transparent url(\''.$GLOBALS['core']->blog->getQmarkURL().'pf=postInfoWidget/img/%s%s.png\') no-repeat left center;"';
|
||||
if ($w->style == 'small') {
|
||||
$s = sprintf($s, 16, $i, '-small');
|
||||
}
|
||||
elseif($w->style == 'normal') {
|
||||
$s = sprintf($s, 20, $i, '');
|
||||
}
|
||||
else {
|
||||
$s = '';
|
||||
}
|
||||
$l = '<li class="postinfo-%s"%s>%s</li>';
|
||||
|
||||
return sprintf($l, $i, $s, $c);
|
||||
}
|
||||
|
||||
public static function nav($p, $d, $r, $t, $c)
|
||||
{
|
||||
global $core;
|
||||
|
||||
$rs = $core->blog->getNextPost($p, $d, $r);
|
||||
if ($rs !== null) {
|
||||
$l = '<a href="%s" title="%s">%s</a>';
|
||||
$u = $rs->getURL();
|
||||
$e = html::escapeHTML($rs->post_title);
|
||||
|
||||
return str_replace(
|
||||
array('%T', '%F'),
|
||||
array(sprintf($l, $u, $e, $t), sprintf($l, $u, $t, $e)),
|
||||
$c
|
||||
);
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
BIN
img/attachment-small.png
Normal file
After Width: | Height: | Size: 364 B |
BIN
img/attachment.png
Normal file
After Width: | Height: | Size: 581 B |
BIN
img/author-small.png
Normal file
After Width: | Height: | Size: 599 B |
BIN
img/author.png
Normal file
After Width: | Height: | Size: 744 B |
BIN
img/category-small.png
Normal file
After Width: | Height: | Size: 365 B |
BIN
img/category.png
Normal file
After Width: | Height: | Size: 401 B |
BIN
img/comment-small.png
Normal file
After Width: | Height: | Size: 472 B |
BIN
img/comment.png
Normal file
After Width: | Height: | Size: 674 B |
BIN
img/create-small.png
Normal file
After Width: | Height: | Size: 350 B |
BIN
img/create.png
Normal file
After Width: | Height: | Size: 434 B |
BIN
img/date-small.png
Normal file
After Width: | Height: | Size: 408 B |
BIN
img/date.png
Normal file
After Width: | Height: | Size: 706 B |
BIN
img/feed-small.png
Normal file
After Width: | Height: | Size: 484 B |
BIN
img/feed.png
Normal file
After Width: | Height: | Size: 688 B |
BIN
img/flags/ad.png
Normal file
After Width: | Height: | Size: 643 B |
BIN
img/flags/ae.png
Normal file
After Width: | Height: | Size: 408 B |
BIN
img/flags/af.png
Normal file
After Width: | Height: | Size: 604 B |
BIN
img/flags/ag.png
Normal file
After Width: | Height: | Size: 591 B |
BIN
img/flags/ai.png
Normal file
After Width: | Height: | Size: 643 B |
BIN
img/flags/al.png
Normal file
After Width: | Height: | Size: 600 B |
BIN
img/flags/am.png
Normal file
After Width: | Height: | Size: 497 B |
BIN
img/flags/an.png
Normal file
After Width: | Height: | Size: 488 B |
BIN
img/flags/ao.png
Normal file
After Width: | Height: | Size: 428 B |
BIN
img/flags/ar.png
Normal file
After Width: | Height: | Size: 506 B |
BIN
img/flags/as.png
Normal file
After Width: | Height: | Size: 647 B |
BIN
img/flags/at.png
Normal file
After Width: | Height: | Size: 403 B |
BIN
img/flags/au.png
Normal file
After Width: | Height: | Size: 673 B |
BIN
img/flags/aw.png
Normal file
After Width: | Height: | Size: 524 B |
BIN
img/flags/ax.png
Normal file
After Width: | Height: | Size: 663 B |
BIN
img/flags/az.png
Normal file
After Width: | Height: | Size: 589 B |
BIN
img/flags/ba.png
Normal file
After Width: | Height: | Size: 593 B |
BIN
img/flags/bb.png
Normal file
After Width: | Height: | Size: 585 B |
BIN
img/flags/bd.png
Normal file
After Width: | Height: | Size: 504 B |
BIN
img/flags/be.png
Normal file
After Width: | Height: | Size: 449 B |
BIN
img/flags/bf.png
Normal file
After Width: | Height: | Size: 497 B |
BIN
img/flags/bg.png
Normal file
After Width: | Height: | Size: 462 B |
BIN
img/flags/bh.png
Normal file
After Width: | Height: | Size: 457 B |
BIN
img/flags/bi.png
Normal file
After Width: | Height: | Size: 675 B |
BIN
img/flags/bj.png
Normal file
After Width: | Height: | Size: 486 B |
BIN
img/flags/bm.png
Normal file
After Width: | Height: | Size: 611 B |
BIN
img/flags/bn.png
Normal file
After Width: | Height: | Size: 639 B |
BIN
img/flags/bo.png
Normal file
After Width: | Height: | Size: 500 B |
BIN
img/flags/br.png
Normal file
After Width: | Height: | Size: 593 B |
BIN
img/flags/bs.png
Normal file
After Width: | Height: | Size: 526 B |
BIN
img/flags/bt.png
Normal file
After Width: | Height: | Size: 631 B |
BIN
img/flags/bv.png
Normal file
After Width: | Height: | Size: 512 B |
BIN
img/flags/bw.png
Normal file
After Width: | Height: | Size: 443 B |
BIN
img/flags/by.png
Normal file
After Width: | Height: | Size: 514 B |
BIN
img/flags/bz.png
Normal file
After Width: | Height: | Size: 600 B |
BIN
img/flags/ca.png
Normal file
After Width: | Height: | Size: 628 B |
BIN
img/flags/catalonia.png
Normal file
After Width: | Height: | Size: 398 B |
BIN
img/flags/cc.png
Normal file
After Width: | Height: | Size: 625 B |
BIN
img/flags/cd.png
Normal file
After Width: | Height: | Size: 528 B |
BIN
img/flags/cf.png
Normal file
After Width: | Height: | Size: 614 B |
BIN
img/flags/cg.png
Normal file
After Width: | Height: | Size: 521 B |
BIN
img/flags/ch.png
Normal file
After Width: | Height: | Size: 367 B |
BIN
img/flags/ci.png
Normal file
After Width: | Height: | Size: 453 B |
BIN
img/flags/ck.png
Normal file
After Width: | Height: | Size: 586 B |
BIN
img/flags/cl.png
Normal file
After Width: | Height: | Size: 450 B |
BIN
img/flags/cm.png
Normal file
After Width: | Height: | Size: 525 B |
BIN
img/flags/cn.png
Normal file
After Width: | Height: | Size: 472 B |
BIN
img/flags/co.png
Normal file
After Width: | Height: | Size: 483 B |
BIN
img/flags/cr.png
Normal file
After Width: | Height: | Size: 477 B |
BIN
img/flags/cs.png
Normal file
After Width: | Height: | Size: 439 B |
BIN
img/flags/cu.png
Normal file
After Width: | Height: | Size: 563 B |
BIN
img/flags/cv.png
Normal file
After Width: | Height: | Size: 529 B |
BIN
img/flags/cx.png
Normal file
After Width: | Height: | Size: 608 B |
BIN
img/flags/cy.png
Normal file
After Width: | Height: | Size: 428 B |
BIN
img/flags/cz.png
Normal file
After Width: | Height: | Size: 476 B |
BIN
img/flags/de.png
Normal file
After Width: | Height: | Size: 545 B |
BIN
img/flags/dj.png
Normal file
After Width: | Height: | Size: 572 B |
BIN
img/flags/dk.png
Normal file
After Width: | Height: | Size: 495 B |
BIN
img/flags/dm.png
Normal file
After Width: | Height: | Size: 620 B |
BIN
img/flags/do.png
Normal file
After Width: | Height: | Size: 508 B |
BIN
img/flags/dz.png
Normal file
After Width: | Height: | Size: 582 B |
BIN
img/flags/ec.png
Normal file
After Width: | Height: | Size: 500 B |
BIN
img/flags/ee.png
Normal file
After Width: | Height: | Size: 429 B |
BIN
img/flags/eg.png
Normal file
After Width: | Height: | Size: 465 B |
BIN
img/flags/eh.png
Normal file
After Width: | Height: | Size: 508 B |
BIN
img/flags/england.png
Normal file
After Width: | Height: | Size: 496 B |
BIN
img/flags/er.png
Normal file
After Width: | Height: | Size: 653 B |
BIN
img/flags/es.png
Normal file
After Width: | Height: | Size: 469 B |
BIN
img/flags/et.png
Normal file
After Width: | Height: | Size: 592 B |
BIN
img/flags/europeanunion.png
Normal file
After Width: | Height: | Size: 479 B |
BIN
img/flags/fam.png
Normal file
After Width: | Height: | Size: 532 B |
BIN
img/flags/fi.png
Normal file
After Width: | Height: | Size: 489 B |
BIN
img/flags/fj.png
Normal file
After Width: | Height: | Size: 610 B |
BIN
img/flags/fk.png
Normal file
After Width: | Height: | Size: 648 B |
BIN
img/flags/fm.png
Normal file
After Width: | Height: | Size: 552 B |
BIN
img/flags/fo.png
Normal file
After Width: | Height: | Size: 474 B |
BIN
img/flags/fr.png
Normal file
After Width: | Height: | Size: 545 B |
BIN
img/flags/ga.png
Normal file
After Width: | Height: | Size: 489 B |
BIN
img/flags/gb.png
Normal file
After Width: | Height: | Size: 599 B |