1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 06:07:32 +02:00

Merge pull request #2232 from MikeyGMT/20161231b

Text to LANS #6 - Polls
This commit is contained in:
Cameron
2017-01-04 08:52:21 -08:00
committed by GitHub
13 changed files with 158 additions and 135 deletions

View File

@@ -1,6 +1,10 @@
<?php <?php
/* /*
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt) * e107 website system
*
* Copyright (C) 2008-2017 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
* *
* English language file - generic terms and system LAN * English language file - generic terms and system LAN
* *
@@ -61,6 +65,7 @@ define("LAN_WARNING", "Warning!");
define("LAN_ERROR", "Error"); define("LAN_ERROR", "Error");
define("LAN_ANONYMOUS", "Anonymous"); define("LAN_ANONYMOUS", "Anonymous");
define("LAN_EMAIL_SUBS", "-email-"); define("LAN_EMAIL_SUBS", "-email-");
define("LAN_ACTIVE","Active");
define("LAN_YES", "Yes"); define("LAN_YES", "Yes");
define("LAN_NO", "No"); define("LAN_NO", "No");
define("LAN_OK", "OK"); define("LAN_OK", "OK");
@@ -84,6 +89,7 @@ define("LAN_DESCRIPTION", "Description");
define("LAN_CANCEL","Cancel"); define("LAN_CANCEL","Cancel");
define("LAN_DATE","Date"); define("LAN_DATE","Date");
define("LAN_DATE_POSTED", "Date posted"); define("LAN_DATE_POSTED", "Date posted");
define("LAN_POSTED_BY", "Posted by");
define("LAN_JSCONFIRM","Are you sure?"); define("LAN_JSCONFIRM","Are you sure?");
define("LAN_IP","IP"); define("LAN_IP","IP");
define("LAN_IP_ADDRESS","IP Address"); define("LAN_IP_ADDRESS","IP Address");

View File

@@ -1,6 +1,10 @@
<?php <?php
/* /*
* Copyright (C) 2008-2016 e107 Inc (e107.org), Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt) * e107 website system
*
* Copyright (C) 2008-2017 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
* *
* Admin Language File * Admin Language File
* *
@@ -233,6 +237,9 @@ define("LAN_UPDATE","Update");
define("LAN_LAST_UPDATED","Last Updated"); define("LAN_LAST_UPDATED","Last Updated");
define("LAN_UPDATE_AVAILABLE","Update Available"); define("LAN_UPDATE_AVAILABLE","Update Available");
define("LAN_ADD", "Add"); define("LAN_ADD", "Add");
define("LAN_ADD_MORE", "Add More");
define("LAN_MULTIPLE_CHOICE", "Multiple Choice");
define("LAN_SAVE","Save"); define("LAN_SAVE","Save");
define("LAN_SAVED","Saved"); define("LAN_SAVED","Saved");
define("LAN_SETSAVED","Your settings have been saved"); define("LAN_SETSAVED","Your settings have been saved");
@@ -306,7 +313,7 @@ define("LAN_LANG","Lang.");
define("LAN_APPROVE","Approve"); define("LAN_APPROVE","Approve");
define("LAN_OPTIONAL", "optional"); define("LAN_OPTIONAL", "optional");
define("LAN_INACTIVE","Inactive"); define("LAN_INACTIVE","Inactive");
define("LAN_ACTIVE","Active"); //define("LAN_ACTIVE","Active");//English.php
define("LAN_ACCEPT","Accept"); define("LAN_ACCEPT","Accept");
define("LAN_PENDING","Pending"); define("LAN_PENDING","Pending");
define("LAN_SUBMITTED","Submitted"); define("LAN_SUBMITTED","Submitted");
@@ -473,6 +480,7 @@ define("LAN_FOLDER", "Folder");
define("LAN_PERSONALIZE_ICONS", "Personalize Icons"); define("LAN_PERSONALIZE_ICONS", "Personalize Icons");
define("LAN_PERSONALIZE_MENUS", "Personalize Menus"); define("LAN_PERSONALIZE_MENUS", "Personalize Menus");
define("LAN_LATEST_COMMENTS", "Latest Comments"); define("LAN_LATEST_COMMENTS", "Latest Comments");
define("LAN_COMMENTS_ALLOWED", "Comments Allowed");
define("LAN_PERSONALIZE", "Personalize"); define("LAN_PERSONALIZE", "Personalize");
define("LAN_SELECT_COLUMNS_TO_DISPLAY", "Select columns to display"); define("LAN_SELECT_COLUMNS_TO_DISPLAY", "Select columns to display");
define("LAN_DISPLAY_COLUMNS", "Display Columns"); define("LAN_DISPLAY_COLUMNS", "Display Columns");

View File

@@ -84,7 +84,15 @@ if (varset($_POST['edit']) || varset($_GET['mode'])=='create' && !varset($_POST[
$poll_total = $sql->select("polls"); $poll_total = $sql->select("polls");
$text = $poll -> renderPollForm(); $text = $poll -> renderPollForm();
$ns->tablerender(POLLAN_MENU_CAPTION.SEP.POLLAN_2, $mes->render() . $text);
if (varset($_GET['mode'])=='create')
{
$ns->tablerender(LAN_PLUGIN_POLL_NAME.SEP.LAN_CREATE, $mes->render() . $text);
}
if (varset($_GET['mode'])=='edit')
{
$ns->tablerender(LAN_PLUGIN_POLL_NAME.SEP.LAN_EDIT, $mes->render() . $text);
}
} }
@@ -211,18 +219,18 @@ function poll_list()
} }
else else
{ {
$mes->addInfo(POLLAN_7); $mes->addInfo(LAN_NO_RECORDS_FOUND);
} }
$text .= "</form>"; $text .= "</form>";
$ns->tablerender(POLLAN_MENU_CAPTION.SEP.POLLAN_1, $mes->render(). $text); $ns->tablerender(LAN_PLUGIN_POLL_NAME.SEP.LAN_MANAGE, $mes->render(). $text);
} }
function admin_config_adminmenu() function admin_config_adminmenu()
{ {
$action = varset($_GET['mode']) ? $_GET['mode'] : "list"; $action = varset($_GET['mode']) ? $_GET['mode'] : "list";
$var['list']['text'] = LAN_EXISTING; $var['list']['text'] = LAN_MANAGE;
$var['list']['link'] = e_SELF; $var['list']['link'] = e_SELF;
$var['list']['perm'] = "P"; $var['list']['perm'] = "P";
$var['create']['text'] = LAN_CREATE ; $var['create']['text'] = LAN_CREATE ;
@@ -231,6 +239,6 @@ function admin_config_adminmenu()
/* $var['import']['text'] = GSLAN_23; /* $var['import']['text'] = GSLAN_23;
$var['import']['link'] = e_SELF."?import"; $var['import']['link'] = e_SELF."?import";
$var['import']['perm'] = "0";*/ $var['import']['perm'] = "0";*/
show_admin_menu(POLLAN_MENU_CAPTION, $action, $var); show_admin_menu(LAN_PLUGIN_POLL_NAME, $action, $var);
} }
?> ?>

View File

@@ -2,16 +2,10 @@
/* /*
* e107 website system * e107 website system
* *
* Copyright (C) 2008-2009 e107 Inc (e107.org) * Copyright (C) 2008-2017 e107 Inc (e107.org)
* Released under the terms and conditions of the * Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
* *
*
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/poll/languages/English.php,v $
* $Revision$
* $Date$
* $Author$
*/ */
//define("POLL_ADLAN01", "Poll"); //define("POLL_ADLAN01", "Poll");
@@ -23,64 +17,64 @@
//define("POLL_ADLAN06", "Forum Thread: "); //define("POLL_ADLAN06", "Forum Thread: ");
//define("POLL_ADLAN07", "Type"); //define("POLL_ADLAN07", "Type");
define("POLLAN_MENU_CAPTION", "Poll"); //define("POLLAN_MENU_CAPTION", "Poll");//LAN_PLUGIN_POLL_NAME
define("POLLAN_1", "Existing polls"); //define("POLLAN_1", "Existing polls");//LAN_MANAGE
define("POLLAN_2", "Create / edit polls"); //define("POLLAN_2", "Create / edit polls");//LAN_CREATE
define("POLLAN_3", "Poll question"); define("POLLAN_3", "Poll Question");
define("POLLAN_4", "Poll Options"); define("POLLAN_4", "Poll Answers");
//define("POLLAN_5", "Edit"); //define("POLLAN_5", "Edit");
//define("POLLAN_6", "Delete"); //define("POLLAN_6", "Delete");
//define("POLLAN_7", "No polls yet."); //define("POLLAN_7", "No polls yet.");//LAN_NO_RECORDS_FOUND
define("POLLAN_8", "Add another option"); //define("POLLAN_8", "Add another option");//LAN_ADD_MORE
define("POLLAN_9", "Allow multiple choices?"); //define("POLLAN_9", "Allow multiple choices?");//LAN_MULTIPLE_CHOICE
define("POLLAN_10", "yes"); //define("POLLAN_10", "yes");//LAN_YES
define("POLLAN_11", "no"); //define("POLLAN_11", "no");//LAN_NO
define("POLLAN_12", "Show results"); define("POLLAN_12", "Show results");
define("POLLAN_13", "after voting"); define("POLLAN_13", "after voting");
define("POLLAN_14", "by clicking view results link - comments must be turned on to use this option"); define("POLLAN_14", "by clicking view results link - comments must be turned on to use this option");
define("POLLAN_15", "Allow to vote on this poll"); define("POLLAN_15", "Allow to vote on this poll");
define("POLLAN_16", "Vote storage method"); define("POLLAN_16", "Vote storage method");
define("POLLAN_17", "cookie"); define("POLLAN_17", "Cookie");
define("POLLAN_18", "IP address"); //define("POLLAN_18", "IP address");//LAN_IP_ADDRESS
define("POLLAN_19", "User ID (only members can vote)"); define("POLLAN_19", "User ID (only members can vote)");
define("POLLAN_20", "Allow comments to be posted to this poll?"); //define("POLLAN_20", "Allow comments to be posted to this poll?");//LAN_COMMENTS_ALLOWED
define("POLLAN_21", "Preview again"); //define("POLLAN_21", "Preview again");//NOT USED
define("POLLAN_22", "Update Poll"); //define("POLLAN_22", "Update Poll");
define("POLLAN_23", "Create Poll"); //define("POLLAN_23", "Create Poll");//LAN_CREATE
define("POLLAN_24", "Preview"); //define("POLLAN_24", "Preview");//LAN_PREVIEW
define("POLLAN_25", "Clear form"); //define("POLLAN_25", "Clear form");//LAN_CLEAR
define("POLLAN_26", "votes"); //define("POLLAN_26", "votes");//NOT USED
// define("POLLAN_27", "Comments"); // define("POLLAN_27", "Comments");
define("POLLAN_28", "Previous polls"); define("POLLAN_28", "Previous polls");
define("POLLAN_29", "posted by"); //define("POLLAN_29", "posted by");//NOT USED
define("POLLAN_30", "Submit"); //define("POLLAN_30", "Submit");//NOT USED
define("POLLAN_31", "Votes"); define("POLLAN_31", "Votes");
define("POLLAN_32", "Click here to see results"); //define("POLLAN_32", "Click here to see results");//NOT USED
define("POLLAN_33", "No previous polls yet."); //define("POLLAN_33", "No previous polls yet.");//LAN_NO_RECORDS_FOUND
//define("POLLAN_34", "Title");//LAN_TITLE //define("POLLAN_34", "Title");//LAN_TITLE
define("POLLAN_35", "Posted by"); //define("POLLAN_35", "Posted by");//LAN_POSTED_BY
define("POLLAN_36", "Active"); //define("POLLAN_36", "Active");//LAN_ACTIVE
define("POLLAN_37", "active from"); //define("POLLAN_37", "active from");//LAN_FROM
define("POLLAN_38", "to"); //define("POLLAN_38", "to");// LAN_TO
define("POLLAN_39", "Thank you for voting!"); //define("POLLAN_39", "Thank you for voting!");//LAN_THANK_YOU
define("POLLAN_40", "Click here to see results"); define("POLLAN_40", "Click here to see results");
define("POLLAN_41", "This poll is restricted to members only"); define("POLLAN_41", "This poll is restricted to members only");
define("POLLAN_42", "This poll is restricted to administrators only"); define("POLLAN_42", "This poll is restricted to administrators only");
define("POLLAN_43", "You do not have the required permissions to vote in this poll"); define("POLLAN_43", "You do not have the required permissions to vote in this poll");
define("POLLAN_44", "Delete this poll?"); //define("POLLAN_44", "Delete this poll?");//NOT USED
define("POLLAN_45", "Poll successfully updated"); //define("POLLAN_45", "Poll successfully updated");//NOT USED
//define("POLLAN_46", "Field(s) left blank"); //define("POLLAN_46", "Field(s) left blank");
// TODO NEED TO BE RENAMED! // TODO NEED TO BE RENAMED!
define("LAN_FORUM_3029", "If you do not wish to add a poll to your topic, leave the fields blank."); // LAN_386 define("LAN_FORUM_3029", "If you do not wish to add a poll to your topic, leave the fields blank."); // LAN_386
define("LAN_FORUM_3030", "Poll question"); // LAN_5 //define("LAN_FORUM_3030", "Poll question"); // LAN_5//POLLAN_3
define("LAN_FORUM_3031", "Poll answer"); // LAN_391 //define("LAN_FORUM_3031", "Poll answer"); // LAN_391//POLLAN_4
define("LAN_FORUM_3032", "Add another answer"); // LAN_6 //define("LAN_FORUM_3032", "Add another answer"); // LAN_6//LAN_ADD_MORE
define("LAN_FORUM_3033", "Allow multiple choices?"); // LAN_506 //define("LAN_FORUM_3033", "Allow multiple choices?"); // LAN_506//LAN_MULTIPLE_CHOICE
define("LAN_FORUM_3034", "Vote storage method"); // POLLAN_16 //define("LAN_FORUM_3034", "Vote storage method"); // POLLAN_16//POLLAN_16
define("LAN_FORUM_3035", "Cookie"); // POLLAN_17 //define("LAN_FORUM_3035", "Cookie"); // POLLAN_17
define("LAN_FORUM_3036", "IP address"); // POLLAN_18 //define("LAN_FORUM_3036", "IP address"); // POLLAN_18//LAN_IP_ADDRESS
define("LAN_FORUM_3037", "User ID (only members can vote)"); // POLLAN_19 //define("LAN_FORUM_3037", "User ID (only members can vote)"); // POLLAN_19

View File

@@ -10,15 +10,15 @@
//define("POLL_ADLAN01", "Poll"); //define("POLL_ADLAN01", "Poll");
//define("POLL_ADLAN02", "The poll plugin allows you to define polls in either a menu or forum post."); //define("POLL_ADLAN02", "The poll plugin allows you to define polls in either a menu or forum post.");
define("POLL_ADLAN03", "Configure polls"); //define("POLL_ADLAN03", "Configure polls");//LAN_CONFIGURE
define("POLL_ADLAN04", "The poll plugin has been successfully installed. To add polls, click on the Polls icon in the plugin section of your admin front page, and remember to activate the menu item from your menus page."); define("POLL_ADLAN04", "The poll plugin has been successfully installed. To add polls, click on the Polls icon in the plugin section of your admin front page, and remember to activate the menu item from your menus page.");
define("POLL_ADLAN05", "Main Poll: "); //define("POLL_ADLAN05", "Main Poll: ");//NOT USED
define("POLL_ADLAN06", "Forum Thread: "); //define("POLL_ADLAN06", "Forum Thread: ");//NOT USED
define("POLL_ADLAN07", "Type"); //define("POLL_ADLAN07", "Type");//NOT USED
//define("POLL_ADLAN08", "Poll deleted"); //define("POLL_ADLAN08", "Poll deleted");
define("POLLAN_MENU_CAPTION", "Poll"); //define("POLLAN_MENU_CAPTION", "Poll");//LAN_PLUGIN_POLL_NAME
//define("POLLAN_1", "Existing polls"); //define("POLLAN_1", "Existing polls");
//define("POLLAN_2", "Create / edit polls"); //define("POLLAN_2", "Create / edit polls");
@@ -26,7 +26,7 @@ define("POLLAN_MENU_CAPTION", "Poll");
//define("POLLAN_4", "Poll Options"); //define("POLLAN_4", "Poll Options");
//define("POLLAN_5", "Edit"); //define("POLLAN_5", "Edit");
//define("POLLAN_6", "Delete"); //define("POLLAN_6", "Delete");
define("POLLAN_7", "No polls yet."); //define("POLLAN_7", "No polls yet.");//LAN_NO_RECORDS_FOUND
/* /*
define("POLLAN_8", "Add another option"); define("POLLAN_8", "Add another option");
define("POLLAN_9", "Allow multiple choices?"); define("POLLAN_9", "Allow multiple choices?");
@@ -70,9 +70,9 @@ define("POLLAN_44", "Delete this poll?");
//define("POLLAN_46", "Field(s) left blank"); //define("POLLAN_46", "Field(s) left blank");
// Log messages // Log messages
define("LAN_AL_POLL_01","Poll deleted"); //define("LAN_AL_POLL_01","Poll deleted");//CHANGED TO EXISTING LANS
define("LAN_AL_POLL_02","Poll updated"); //define("LAN_AL_POLL_02","Poll updated");//NOT USED
define("LAN_AL_POLL_03","Poll added"); //define("LAN_AL_POLL_03","Poll added");//NOT USED
define("LAN_AL_POLL_04",""); //define("LAN_AL_POLL_04","");//NOT USED
define("LAN_AL_POLL_05",""); //define("LAN_AL_POLL_05","");//NOT USED

View File

@@ -1,4 +1,12 @@
<?php <?php
/*
* e107 website system
*
* Copyright (C) 2008-2017 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
*/
define("LAN_PLUGIN_POLL_NAME", "Poll"); define("LAN_PLUGIN_POLL_NAME", "Poll");
define("LAN_PLUGIN_POLL_DESCRIPTION", "The poll plugin allows you to define polls in either a menu or forum post."); define("LAN_PLUGIN_POLL_DESCRIPTION", "The poll plugin allows you to define polls in either a menu or forum post.");

View File

@@ -2,16 +2,10 @@
/* /*
* e107 website system * e107 website system
* *
* Copyright (C) 2008-2009 e107 Inc (e107.org) * Copyright (C) 2008-2017 e107 Inc (e107.org)
* Released under the terms and conditions of the * Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
* *
*
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/poll/oldpolls.php,v $
* $Revision$
* $Date$
* $Author$
*/ */
require_once("../../class2.php"); require_once("../../class2.php");
@@ -57,7 +51,7 @@ if(e_QUERY)
$text .= " $text .= "
<div class='smalltext text-right'> <div class='smalltext text-right'>
<small>".POLLAN_35." ".$userlink."<br /> ".POLLAN_37." ".$start_datestamp." ".POLLAN_38." ".$end_datestamp."</small></div> <small>".LAN_POSTED_BY." ".$userlink."<br /> ".LAN_ACTIVE.": ".LAN_FROM." ".$start_datestamp." ".LAN_TO." ".$end_datestamp."</small></div>
"; ";
@@ -80,7 +74,8 @@ if(e_QUERY)
</div> </div>
<div style='background-image: url($barr); width: 5px; height: 14px; float: left;'> <div style='background-image: url($barr); width: 5px; height: 14px; float: left;'>
</div> </div>
".$percentage[$count]."% [".POLLAN_31.": ".$voteArray[$count]."] ".$percentage[$count]."% [".POL
LAN_31.": ".$voteArray[$count]."]
</td> </td>
</tr>\n"; </tr>\n";
$count++; $count++;
@@ -120,7 +115,7 @@ if(e_QUERY)
if(!$array = $sql->retrieve($query,true)) if(!$array = $sql->retrieve($query,true))
{ {
$ns->tablerender(POLLAN_28, "<div style='text-align:center'>".POLLAN_33."</div>"); $ns->tablerender(POLLAN_28, "<div style='text-align:center'>".LAN_NO_RECORDS_FOUND."</div>");
require_once(FOOTERF); require_once(FOOTERF);
exit; exit;
} }
@@ -129,7 +124,7 @@ if(e_QUERY)
if(empty($array)) if(empty($array))
{ {
$ns->tablerender(POLLAN_28, "<div style='text-align:center'>".POLLAN_33."</div>"); $ns->tablerender(POLLAN_28, "<div style='text-align:center'>".LAN_NO_RECORDS_FOUND."</div>");
require_once(FOOTERF); require_once(FOOTERF);
exit; exit;
} }
@@ -142,8 +137,8 @@ if(e_QUERY)
<thead> <thead>
<tr> <tr>
<th class='fcaption'>".LAN_TITLE."</th> <th class='fcaption'>".LAN_TITLE."</th>
<th class='fcaption'>".POLLAN_35."</th> <th class='fcaption'>".LAN_POSTED_BY."</th>
<th class='fcaption'>".POLLAN_36."</th> <th class='fcaption'>".LAN_ACTIVE."</th>
</tr></thead><tbody>\n"; </tr></thead><tbody>\n";
@@ -164,7 +159,7 @@ if(e_QUERY)
$text .= "<tr> $text .= "<tr>
<td class='forumheader3' style='width: 55%;'><a href='".e_SELF."?".$row['poll_id']."'>{$poll_title}</a></td> <td class='forumheader3' style='width: 55%;'><a href='".e_SELF."?".$row['poll_id']."'>{$poll_title}</a></td>
<td class='forumheader3' style='width: 15%;'>".$userlink."</td> <td class='forumheader3' style='width: 15%;'>".$userlink."</td>
<td class='forumheader3' style='width: 30%;'>".$from." ".POLLAN_38." ".$to."</td> <td class='forumheader3' style='width: 30%;'>".$from." ".LAN_TO." ".$to."</td>
</tr>\n"; </tr>\n";
} }

View File

@@ -5,7 +5,7 @@
<category>content</category> <category>content</category>
<copyright>Copyright e107 Inc e107.org, Licensed under GPL (http://www.gnu.org/licenses/gpl.txt)</copyright> <copyright>Copyright e107 Inc e107.org, Licensed under GPL (http://www.gnu.org/licenses/gpl.txt)</copyright>
<adminLinks> <adminLinks>
<link url='admin_config.php' description='POLL_ADLAN03' icon='images/polls_32.png' iconSmall='images/polls_16.png' primary='true' >POLL_ADLAN03</link> <link url='admin_config.php' description='LAN_CONFIGURE' icon='images/polls_32.png' iconSmall='images/polls_16.png' primary='true' >LAN_CONFIGURE</link>
</adminLinks> </adminLinks>
<pluginPrefs> <pluginPrefs>
</pluginPrefs> </pluginPrefs>

View File

@@ -2,7 +2,7 @@
/* /*
* e107 website system * e107 website system
* *
* Copyright (C) 2008-2011 e107 Inc (e107.org) * Copyright (C) 2008-2017 e107 Inc (e107.org)
* Released under the terms and conditions of the * Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
* *

View File

@@ -2,7 +2,7 @@
/* /*
* e107 website system * e107 website system
* *
* Copyright (C) 2008-2013 e107 Inc (e107.org) * Copyright (C) 2008-2017 e107 Inc (e107.org)
* Released under the terms and conditions of the * Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
* *
@@ -84,7 +84,7 @@ class poll
{ {
admin_purge_related("poll", $existing); admin_purge_related("poll", $existing);
} }
e107::getLog()->add('POLL_01',LAN_AL_POLL_01.': '.$existing,''); e107::getLog()->add('POLL_01',POLLAN_3.': '.LAN_DELETED.': '.$existing,'');
//return POLL_ADLAN08; //return POLL_ADLAN08;
} }
} }
@@ -511,7 +511,7 @@ class poll
if ($pollArray['poll_result_type'] && !strstr(e_SELF, "comment.php")) if ($pollArray['poll_result_type'] && !strstr(e_SELF, "comment.php"))
{ {
$text = "<div style='text-align: center;'><br /><br />".POLLAN_39."<br /><br /><a href='".e_HTTP."comment.php?comment.poll.".$pollArray['poll_id']."'>".POLLAN_40."</a></div><br /><br />"; $text = "<div style='text-align: center;'><br /><br />".LAN_THANK_YOU."<br /><br /><a href='".e_HTTP."comment.php?comment.poll.".$pollArray['poll_id']."'>".POLLAN_40."</a></div><br /><br />";
} }
else else
{ {
@@ -564,11 +564,11 @@ class poll
if (!defined("POLLRENDERED")) define("POLLRENDERED", TRUE); if (!defined("POLLRENDERED")) define("POLLRENDERED", TRUE);
$caption = (file_exists(THEME."images/poll_menu.png") ? "<img src='".THEME_ABS."images/poll_menu.png' alt='' /> ".POLLAN_MENU_CAPTION : POLLAN_MENU_CAPTION); $caption = (file_exists(THEME."images/poll_menu.png") ? "<img src='".THEME_ABS."images/poll_menu.png' alt='' /> ".LAN_PLUGIN_POLL_NAME : LAN_PLUGIN_POLL_NAME);
if ($type == 'preview') if ($type == 'preview')
{ {
$caption = POLLAN_23.SEP.LAN_PREVIEW; // "Preview"; // TODO LAN $caption = LAN_CREATE.SEP.LAN_PREVIEW; // "Preview"; // TODO not sure this is used.
$text = "<div class='clearfix'>\n<div class='well span3'>".$text."</div></div>"; $text = "<div class='clearfix'>\n<div class='well span3'>".$text."</div></div>";
} }
elseif ($type == 'forum') elseif ($type == 'forum')
@@ -649,14 +649,14 @@ class poll
$text .= " $text .= "
<div class='form-group'> <div class='form-group'>
<label for='poll_title'>Poll question</label> <label for='poll_title'>".POLLAN_3."</label>
".$frm->text('poll_title', $tp->post_toForm(vartrue($_POST['poll_title'])), '200', array('placeholder' => LAN_FORUM_3030, 'id' => 'poll_title'))." ".$frm->text('poll_title', $tp->post_toForm(vartrue($_POST['poll_title'])), '200', array('placeholder' => POLLAN_3, 'id' => 'poll_title'))."
</div>"; </div>";
$option_count = vartrue($_POST['poll_option']) ? count($_POST['poll_option']) : 2; $option_count = vartrue($_POST['poll_option']) ? count($_POST['poll_option']) : 2;
$text .= " $text .= "
<div id='pollsection'> <div id='pollsection'>
<label for='pollopt'>Poll answers</label>"; <label for='pollopt'>".POLLAN_4."</label>";
for($count = 1; $count <= $option_count; $count++) for($count = 1; $count <= $option_count; $count++)
{ {
@@ -668,14 +668,14 @@ class poll
$opt = ($count==1) ? "id='poll_answer'" : ""; $opt = ($count==1) ? "id='poll_answer'" : "";
$text .= "<div class='form-group' ".$opt."> $text .= "<div class='form-group' ".$opt.">
".$frm->text('poll_option[]', $_POST['poll_option'][($count-1)], '200', array('placeholder' => LAN_FORUM_3031, 'id' => $opt))." ".$frm->text('poll_option[]', $_POST['poll_option'][($count-1)], '200', array('placeholder' => POLLAN_4, 'id' => $opt))."
</div>"; </div>";
} }
$text .= "</div>"; // end pollsection div $text .= "</div>"; // end pollsection div
$text .= "<div class='form-group control-group'> $text .= "<div class='form-group control-group'>
<input class='btn btn-default' type='button' id='addoption' name='addoption' value='".LAN_FORUM_3032."' /> <input class='btn btn-default' type='button' id='addoption' name='addoption' value='".LAN_ADD_MORE."' />
</div> </div>
"; ";
@@ -688,7 +688,7 @@ class poll
$text .= "<br /> $text .= "<br />
<div class='form-horizontal control-group'> <div class='form-horizontal control-group'>
<label class='control-label'>".LAN_FORUM_3033."</label> <label class='control-label'>".LAN_MULTIPLE_CHOICE."</label>
<div class='radio controls'> <div class='radio controls'>
". $frm->radio('multipleChoice',$opts, vartrue($_POST['multipleChoice'], 0) ).$frm->hidden('storageMethod', 1)." ". $frm->radio('multipleChoice',$opts, vartrue($_POST['multipleChoice'], 0) ).$frm->hidden('storageMethod', 1)."
</div> </div>
@@ -718,7 +718,7 @@ class poll
".POLLAN_16." ".POLLAN_16."
<input type='radio' name='storageMethod' value='0'".(!vartrue($_POST['storageMethod']) ? " checked='checked'" : "")." /> ".POLLAN_17."<br /> <input type='radio' name='storageMethod' value='0'".(!vartrue($_POST['storageMethod']) ? " checked='checked'" : "")." /> ".POLLAN_17."<br />
<input type='radio' name='storageMethod' value='1'".($_POST['storageMethod'] == 1 ? " checked='checked'" : "")." /> ".POLLAN_18."<br /> <input type='radio' name='storageMethod' value='1'".($_POST['storageMethod'] == 1 ? " checked='checked'" : "")." /> ".LAN_IP_ADDRESS."<br />
<input type='radio' name='storageMethod' value='2'".($_POST['storageMethod'] ==2 ? " checked='checked'" : "")." /> ".POLLAN_19." <input type='radio' name='storageMethod' value='2'".($_POST['storageMethod'] ==2 ? " checked='checked'" : "")." /> ".POLLAN_19."
</div> </div>
"; ";
@@ -736,14 +736,14 @@ class poll
<td class='forumheader3' colspan='2'><span class='smalltext'>".LAN_FORUM_3029."</span></td> <td class='forumheader3' colspan='2'><span class='smalltext'>".LAN_FORUM_3029."</span></td>
</tr> </tr>
<tr> <tr>
<td class='forumheader3' style='width:20%'><div class='normaltext'>".LAN_FORUM_3030.": </div></td> <td class='forumheader3' style='width:20%'><div class='normaltext'>".POLLAN_3.": </div></td>
<td class='forumheader3' style='width:80%' class='forumheader3'><input class='tbox' type='text' name='poll_title' size='70' value='".$tp->post_toForm(vartrue($_POST['poll_title']))."' maxlength='200' /></td> <td class='forumheader3' style='width:80%' class='forumheader3'><input class='tbox' type='text' name='poll_title' size='70' value='".$tp->post_toForm(vartrue($_POST['poll_title']))."' maxlength='200' /></td>
</tr>"; </tr>";
$option_count = (count(vartrue($_POST['poll_option'])) ? count($_POST['poll_option']) : 1); $option_count = (count(vartrue($_POST['poll_option'])) ? count($_POST['poll_option']) : 1);
$text .= " $text .= "
<tr> <tr>
<td class='forumheader3' style='width:20%'>".LAN_FORUM_3031."</td> <td class='forumheader3' style='width:20%'>".POLLAN_4."</td>
<td class='forumheader3' style='width:80%'> <td class='forumheader3' style='width:80%'>
<div id='pollsection'>"; <div id='pollsection'>";
@@ -761,22 +761,22 @@ class poll
$text .=" $text .="
</div> </div>
<input class='btn btn-default button' type='button' name='addoption' value='".LAN_FORUM_3032."' onclick=\"duplicateHTML('pollopt','pollsection')\" /><br /> <input class='btn btn-default button' type='button' name='addoption' value='".LAN_ADD_MORE."' onclick=\"duplicateHTML('pollopt','pollsection')\" /><br />
</td> </td>
</tr> </tr>
<tr> <tr>
<td class='forumheader3' style='width:20%'>".LAN_FORUM_3033."</td> <td class='forumheader3' style='width:20%'>".LAN_MULTIPLE_CHOICE."</td>
<td class='forumheader3' style='width:80%'> <td class='forumheader3' style='width:80%'>
<input type='radio' name='multipleChoice' value='1'".(vartrue($_POST['multipleChoice']) ? " checked='checked'" : "")." /> ".LAN_YES."&nbsp;&nbsp; <input type='radio' name='multipleChoice' value='1'".(vartrue($_POST['multipleChoice']) ? " checked='checked'" : "")." /> ".LAN_YES."&nbsp;&nbsp;
<input type='radio' name='multipleChoice' value='0'".(!$_POST['multipleChoice'] ? " checked='checked'" : "")." /> ".LAN_NO." <input type='radio' name='multipleChoice' value='0'".(!$_POST['multipleChoice'] ? " checked='checked'" : "")." /> ".LAN_NO."
</td> </td>
</tr> </tr>
<tr> <tr>
<td class='forumheader3'style='width:30%'>".LAN_FORUM_3034."</td> <td class='forumheader3'style='width:30%'>".POLLAN_16."</td>
<td class='forumheader3'> <td class='forumheader3'>
<input type='radio' name='storageMethod' value='0'".(!vartrue($_POST['storageMethod']) ? " checked='checked'" : "")." /> ".LAN_FORUM_3035."<br /> <input type='radio' name='storageMethod' value='0'".(!vartrue($_POST['storageMethod']) ? " checked='checked'" : "")." /> ".POLLAN_17."<br />
<input type='radio' name='storageMethod' value='1'".($_POST['storageMethod'] == 1 ? " checked='checked'" : "")." /> ".LAN_FORUM_3036."<br /> <input type='radio' name='storageMethod' value='1'".($_POST['storageMethod'] == 1 ? " checked='checked'" : "")." /> ".LAN_IP_ADDRESS."<br />
<input type='radio' name='storageMethod' value='2'".($_POST['storageMethod'] ==2 ? " checked='checked'" : "")." /> ".LAN_FORUM_3037." <input type='radio' name='storageMethod' value='2'".($_POST['storageMethod'] ==2 ? " checked='checked'" : "")." /> ".POLLAN_19."
</td> </td>
</tr> </tr>
"; ";
@@ -813,14 +813,14 @@ class poll
$text .= "</span><br />"; $text .= "</span><br />";
} }
$text .="</div><input class='btn btn-default' type='button' name='addoption' value='".POLLAN_8."' onclick=\"duplicateHTML('pollopt','pollsection')\" /><br /> $text .="</div><input class='btn btn-default' type='button' name='addoption' value='".LAN_ADD_MORE."' onclick=\"duplicateHTML('pollopt','pollsection')\" /><br />
</td></tr> </td></tr>
<tr> <tr>
<td style='width:30%'>".POLLAN_9."</td> <td style='width:30%'>".LAN_MULTIPLE_CHOICE."</td>
<td style='width:70%'> <td style='width:70%'>
<input type='radio' name='multipleChoice' value='1'".(varset($_POST['multipleChoice']) ? " checked='checked'" : "")." /> ".POLLAN_10."&nbsp;&nbsp; <input type='radio' name='multipleChoice' value='1'".(varset($_POST['multipleChoice']) ? " checked='checked'" : "")." /> ".LAN_YES."&nbsp;&nbsp;
<input type='radio' name='multipleChoice' value='0'".(!varset($_POST['multipleChoice']) ? " checked='checked'" : "")." /> ".POLLAN_11." <input type='radio' name='multipleChoice' value='0'".(!varset($_POST['multipleChoice']) ? " checked='checked'" : "")." /> ".LAN_NO."
</td> </td>
</tr> </tr>
@@ -846,14 +846,14 @@ class poll
<td style='width:30%'>".POLLAN_16."</td> <td style='width:30%'>".POLLAN_16."</td>
<td> <td>
<input type='radio' name='storageMethod' value='0'".(!varset($_POST['storageMethod']) ? " checked='checked'" : "")." /> ".POLLAN_17."<br /> <input type='radio' name='storageMethod' value='0'".(!varset($_POST['storageMethod']) ? " checked='checked'" : "")." /> ".POLLAN_17."<br />
<input type='radio' name='storageMethod' value='1'".(varset($_POST['storageMethod']) ==1 ? " checked='checked'" : "")." /> ".POLLAN_18."<br /> <input type='radio' name='storageMethod' value='1'".(varset($_POST['storageMethod']) ==1 ? " checked='checked'" : "")." /> ".LAN_IP_ADDRESS."<br />
<input type='radio' name='storageMethod' value='2'".(varset($_POST['storageMethod']) ==2 ? " checked='checked'" : "")." /> ".POLLAN_19." <input type='radio' name='storageMethod' value='2'".(varset($_POST['storageMethod']) ==2 ? " checked='checked'" : "")." /> ".POLLAN_19."
</td></tr> </td></tr>
<tr> <tr>
<td>".POLLAN_20.": </td><td> <td>".LAN_COMMENTS_ALLOWED.": </td><td>
<input type='radio' name='poll_comment' value='1'".(varset($_POST['poll_comment']) ? " checked='checked'" : "")." /> ".POLLAN_10." <input type='radio' name='poll_comment' value='1'".(varset($_POST['poll_comment']) ? " checked='checked'" : "")." /> ".LAN_YES."
<input type='radio' name='poll_comment' value='0'".(!varset($_POST['poll_comment']) ? " checked='checked'" : "")." /> ".POLLAN_11." <input type='radio' name='poll_comment' value='0'".(!varset($_POST['poll_comment']) ? " checked='checked'" : "")." /> ".LAN_NO."
</td> </td>
</tr> </tr>
</table> </table>
@@ -861,8 +861,8 @@ class poll
if (isset($_POST['preview']) || varset($_POST['edit'])) if (isset($_POST['preview']) || varset($_POST['edit']))
{ {
// $text .= "<input type='submit' name='preview' value='".POLLAN_24."' /> "; // $text .= "<input type='submit' name='preview' value='".LAN_PREVIEW."' /> ";
$text .= $frm->admin_button('preview',POLLAN_24,'other'); $text .= $frm->admin_button('preview',LAN_PREVIEW,'other');
if (POLLACTION == 'edit') if (POLLACTION == 'edit')
{ {
@@ -878,14 +878,14 @@ class poll
} }
else else
{ {
$text .= $frm->admin_button('preview','no-value','other',POLLAN_24); $text .= $frm->admin_button('preview','no-value','other',LAN_PREVIEW);
// $text .= "<input type='submit' name='preview' value='".POLLAN_24."' /> "; // $text .= "<input type='submit' name='preview' value='".LAN_PREVIEW."' /> ";
} }
if (defset('POLLID')) if (defset('POLLID'))
{ {
$text .= $frm->admin_button('reset','no-value','reset',POLLAN_25); $text .= $frm->admin_button('reset','no-value','reset',LAN_CLEAR);
// $text .= "<input type='submit' name='reset' value='".POLLAN_25."' /> "; // $text .= "<input type='submit' name='reset' value='".LAN_CLEAR."' /> ";
} }
$text .= "</div> $text .= "</div>
@@ -946,7 +946,7 @@ class poll_shortcodes extends e_shortcode
$userlink = "<a href='".$link."'>".$this->var['user_name']."</a>"; $userlink = "<a href='".$link."'>".$this->var['user_name']."</a>";
// return print_a($this->var,true); // return print_a($this->var,true);
return POLLAN_35." ".(($this->pollType == 'preview' || $this->pollType == 'forum') ? USERNAME : $userlink); return LAN_POSTED_BY." ".(($this->pollType == 'preview' || $this->pollType == 'forum') ? USERNAME : $userlink);
} }
@@ -1049,10 +1049,10 @@ class poll_shortcodes extends e_shortcode
if (('preview' == $this->pollType || $this->pollPreview == true) && strpos(e_REQUEST_SELF, "forum") === false) if (('preview' == $this->pollType || $this->pollPreview == true) && strpos(e_REQUEST_SELF, "forum") === false)
{ {
return "<input class='button btn btn-default e-tip' type='button' name='null' title='Disabled' value='".POLLAN_30."' />"; return "<input class='button btn btn-default e-tip' type='button' name='null' title='".LAN_SUBMIT."' value='".LAN_SUBMIT."' />";
} }
return "<input class='button btn btn-primary' type='submit' name='pollvote' value='".POLLAN_30."' />"; return "<input class='button btn btn-primary' type='submit' name='pollvote' value='".LAN_SUBMIT."' />";
// disable submit when previewing the poll or when NOT viewing the poll in the forum // disable submit when previewing the poll or when NOT viewing the poll in the forum
} }

View File

@@ -2,7 +2,7 @@
/* /*
* e107 website system * e107 website system
* *
* Copyright (C) 2008-2013 e107 Inc (e107.org) * Copyright (C) 2008-2017 e107 Inc (e107.org)
* Released under the terms and conditions of the * Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
* *
@@ -59,4 +59,5 @@ ORDER BY p.poll_datestamp DESC LIMIT 0,1
$poll->remove_poll_cookies(); $poll->remove_poll_cookies();
$poll->render_poll($query, $pollType, $pollMode); $poll->render_poll($query, $pollType, $pollMode);
?> ?>

View File

@@ -1,11 +1,20 @@
<?php <?php
/*
* e107 website system
*
* Copyright (C) 2008-2017 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
*/
if (!defined('e107_INIT')) { exit; } if (!defined('e107_INIT')) { exit; }
$comments_title = 'Poll'; $comments_title = LAN_PLUGIN_POLL_NAME;
$comments_type_id = 4; $comments_type_id = 4;
$comments_return['poll'] = "po.poll_id, po.poll_title"; $comments_return['poll'] = "po.poll_id, po.poll_title";
$comments_table['poll'] = "LEFT JOIN #polls AS po ON c.comment_type=4 AND po.poll_id = c.comment_item_id"; $comments_table['poll'] = "LEFT JOIN #polls AS po ON c.comment_type=4 AND po.poll_id = c.comment_item_id";
function com_search_4($row) { function com_search_4($row) {
global $con; global $con;
$nick = preg_replace("/[0-9]+\./", "", $row['comment_author']); $nick = preg_replace("/[0-9]+\./", "", $row['comment_author']);

View File

@@ -2,16 +2,10 @@
/* /*
* e107 website system * e107 website system
* *
* Copyright (C) 2008-2009 e107 Inc (e107.org) * Copyright (C) 2008-2017 e107 Inc (e107.org)
* Released under the terms and conditions of the * Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
* *
*
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/poll/templates/poll_template.php,v $
* $Revision$
* $Date$
* $Author$
*/ */
if (!defined('e107_INIT')) { exit; } if (!defined('e107_INIT')) { exit; }