[geeklog-cvs] geeklog: Source code cosmetics (no change in functionality)
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sat Aug 8 08:13:39 EDT 2009
details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/c29961d5e4f0
changeset: 7232:c29961d5e4f0
user: Dirk Haun <dirk at haun-online.de>
date: Sat Aug 08 13:57:57 2009 +0200
description:
Source code cosmetics (no change in functionality)
diffstat:
plugins/polls/functions.inc | 93 +++++++++++++++++++++++-----------------------
1 files changed, 47 insertions(+), 46 deletions(-)
diffs (111 lines):
diff -r 978e9c3ccad8 -r c29961d5e4f0 plugins/polls/functions.inc
--- a/plugins/polls/functions.inc Sat Aug 08 13:48:16 2009 +0200
+++ b/plugins/polls/functions.inc Sat Aug 08 13:57:57 2009 +0200
@@ -1387,60 +1387,61 @@
* [poll-result: pid class:poll-autotag] - Width and showall not required. Class specifies the css class
*
*/
-function plugin_autotags_polls ($op, $content = '', $autotag = '')
+function plugin_autotags_polls($op, $content = '', $autotag = '')
{
global $_CONF, $_TABLES;
-
+
if ($op == 'tagname' ) {
- return array('poll_vote','poll_result','poll');
- } else if ($op == 'parse') {
- $pid = COM_applyFilter ($autotag['parm1']);
- $width = "300";
- $showall= false;
-
- switch( $autotag['tag'] ) {
- case 'poll' :
- if (!empty ($autotag['parm2'])) {
- $title = COM_applyFilter($autotag['parm2']);
- } else {
- $title = DB_getItem ($_TABLES['polltopics'], 'topic', "pid = '$pid'");
- }
+ return array('poll_vote', 'poll_result', 'poll');
+ } elseif ($op == 'parse') {
+ $pid = COM_applyFilter($autotag['parm1']);
+ $showall = false;
- $retval = COM_createLink($title, $_CONF['site_url'] . '/polls/index.php?pid=' . $pid . '&aid=-1');
- break;
- case 'poll_vote' :
- case 'poll_result' :
- $px = explode (' ', trim ($autotag['parm2']));
- $css_class = "poll-autotag";
-
- if (is_array ($px)) {
- foreach ($px as $part) {
- if (substr ($part, 0, 6) == 'class:') {
- $a = explode (':', $part);
- $css_class = $a[1];
- } elseif (substr ($part, 0, 8) == 'showall:') {
- $a = explode (':', $part);
- $val = $a[1];
- if ($val == 1) {
- $showall = true;
- }
- } else {
- break;
+ switch ($autotag['tag']) {
+ case 'poll':
+ if (!empty($autotag['parm2'])) {
+ $title = COM_applyFilter($autotag['parm2']);
+ } else {
+ $title = DB_getItem($_TABLES['polltopics'], 'topic',
+ "pid = '$pid'");
+ }
+
+ $retval = COM_createLink($title, $_CONF['site_url']
+ . '/polls/index.php?pid=' . $pid . '&aid=-1');
+ break;
+
+ case 'poll_vote':
+ case 'poll_result':
+ $px = explode(' ', trim($autotag['parm2']));
+ $css_class = "poll-autotag";
+
+ if (is_array($px)) {
+ foreach ($px as $part) {
+ if (substr($part, 0, 6) == 'class:') {
+ $a = explode(':', $part);
+ $css_class = $a[1];
+ } elseif (substr($part, 0, 8) == 'showall:') {
+ $a = explode(':', $part);
+ $val = $a[1];
+ if ($val == 1) {
+ $showall = true;
}
+ } else {
+ break;
}
}
-
- if ($autotag['tag'] == 'poll_vote') {
- $retval = POLLS_showPoll(0, $pid, $showall, 2);
- } else {
- $retval = POLLS_pollResults($pid, 0,'', '', 2);
- }
- $retval = '<div class="'.$css_class.'">'.$retval.'</div>';
- break;
+ }
+
+ if ($autotag['tag'] == 'poll_vote') {
+ $retval = POLLS_showPoll(0, $pid, $showall, 2);
+ } else {
+ $retval = POLLS_pollResults($pid, 0,'', '', 2);
+ }
+ $retval = '<div class="' . $css_class . '">' . $retval . '</div>';
+ break;
}
-
-
- $content = str_replace ($autotag['tagstr'], $retval, $content);
+
+ $content = str_replace($autotag['tagstr'], $retval, $content);
}
return $content;
More information about the geeklog-cvs
mailing list