Changeset 969689
- Timestamp:
- 08/21/2014 01:03:33 PM (11 years ago)
- Location:
- vote-it-up/trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
vote-it-up/trunk/readme.txt
r969632 r969689 3 3 Tags: post, voting, popularity, feedback, ajax 4 4 Requires at least: 1.5 5 Tested up to: 2.85 Tested up to: 3.9.2 6 6 Stable tag: 1.2.4 7 7 Donate link: http://www.onfry.com/donate.php … … 44 44 45 45 7. Editing votes can be done via the Wordpress Dashboard (`Options > Edit Votes` in Wordpress versions prior to 2.3, `Settings > Edit Votes` in Wordpress versions after 2.5). 46 47 8. Automatic insertion of voting widget to posts can be enabled via a setting in the plugin options 46 48 47 49 == Requirements == … … 152 154 153 155 1.2.4 156 [Feature] - Add the ability to insert voting widget without editing the template 154 157 [Bug Fix] - Patch XSS vulnerability 155 [Bug Fix] - Default skin option now checked properly 158 [Bug Fix] - Default skin option now be selected properly 159 [Bug Fix] - Most voted widget entries now formatted properly 160 [Changed] - Plugin now dual licensed under LGPL and MIT 156 161 157 162 1.2.3 158 Re-designate 1.2.x plugin as unstable.163 [Changed] - Re-designate 1.2.x plugin as unstable. 159 164 160 165 1.2.2 -
vote-it-up/trunk/skin.php
r969632 r969689 52 52 ?> 53 53 <div style="clear:both"> 54 < div style="float:left; padding: 5px;">54 <!--<div style="float:left; padding: 5px;">--> 55 55 <input type="radio" name="voteiu_skin" id="voteiu_skin" value="" <?php IsChecked(''); ?> /> Default<br /> 56 < /div>56 <!--</div>--> 57 57 <?php 58 58 for ($i = 0; $i < count($skins); $i++) { 59 59 ?> 60 <div style="float:left; padding: 5px"><input type="radio" name="voteiu_skin" id="voteiu_skin" value="<?php echo $skins[$i]; ?>" <?php IsChecked($skins[$i]); ?> /> <?php echo ucfirst(str_replace('_', ' ', $skins[$i])); ?></div> 60 <!--<div style="float:left; padding: 5px">--> 61 <input type="radio" name="voteiu_skin" id="voteiu_skin" value="<?php echo $skins[$i]; ?>" <?php IsChecked($skins[$i]); ?> /> <?php echo ucfirst(str_replace('_', ' ', $skins[$i])); ?><br> 62 <!--</div>--> 61 63 <?php 62 64 } -
vote-it-up/trunk/skins/bar/votestyles.css
r94309 r969689 92 92 margin: 0px 5px 0px 0px; 93 93 vertical-align: middle; 94 display: inline ;95 float: left;94 display: inline-block; 95 /*float: left;*/ 96 96 } 97 97 .votemicrotext { 98 98 font-size: 1em; /* 12 */ 99 99 vertical-align: middle; 100 display: inline-block; 100 101 } -
vote-it-up/trunk/skins/orange_ticker/votestyles.css
r94309 r969689 105 105 margin: 0px 5px 0px 0px; 106 106 vertical-align: middle; 107 display: inline ;108 float: left;107 display: inline-block; 108 /*float: left;*/ 109 109 } 110 110 .votemicrotext { 111 111 font-size: 1em; /* 12 */ 112 112 vertical-align: middle; 113 display: inline-block; 113 114 } -
vote-it-up/trunk/skins/percent/votestyles.css
r98204 r969689 124 124 margin: 0px 5px 0px 0px; 125 125 vertical-align: middle; 126 display: inline ;127 float: left;126 display: inline-block; 127 /*float: left;*/ 128 128 } 129 129 .votemicrotext { 130 130 font-size: 1em; /* 12 */ 131 131 vertical-align: middle; 132 display: inline-block; 132 133 } 133 -
vote-it-up/trunk/skins/text/votestyles.css
r94309 r969689 78 78 margin: 0px 5px 0px 0px; 79 79 vertical-align: middle; 80 display: inline ;81 float: left;80 display: inline-block; 81 /*float: left;*/ 82 82 } 83 83 .votemicrotext { 84 84 font-size: 1em; /* 12 */ 85 85 vertical-align: middle; 86 display: inline-block; 86 87 } -
vote-it-up/trunk/skins/ticker/votestyles.css
r94309 r969689 3 3 border: 1px solid #E5E5E5; 4 4 background-color: #F3F3F3; 5 height: 18px;5 /*height: 18px;*/ 6 6 width: 40px; 7 7 font-size: 18px; … … 111 111 margin: 0px 5px 0px 0px; 112 112 vertical-align: middle; 113 display: inline ;114 float: left;113 display: inline-block; 114 /*float: left;*/ 115 115 } 116 116 .votemicrotext { 117 117 font-size: 1em; /* 12 */ 118 118 vertical-align: middle; 119 display: inline-block; 119 120 } -
vote-it-up/trunk/voteconfig.php
r969632 r969689 14 14 function voteitup_alter_whitelist_options($whitelist) { 15 15 if(is_array($whitelist)) { 16 $option_array = array('voteitup' => array('voteiu_initialoffset','voteiu_votetext','voteiu_sinktext','voteiu_aftervotetext','voteiu_allowguests','voteiu_allowownvote','voteiu_limit','voteiu_widgetcount','voteiu_skin' ));16 $option_array = array('voteitup' => array('voteiu_initialoffset','voteiu_votetext','voteiu_sinktext','voteiu_aftervotetext','voteiu_allowguests','voteiu_allowownvote','voteiu_limit','voteiu_widgetcount','voteiu_skin','voteiu_autoinsert')); 17 17 $whitelist = array_merge($whitelist,$option_array); 18 18 } … … 59 59 <td> 60 60 <input type="text" name="voteiu_votetext" class="regular-text" id="voteiu_votetext" value="<?php echo htmlentities(get_option('voteiu_votetext')); ?>" /><br /> 61 You can use <code><img></code> to use images instead of text. Example: <code><img src="<?php echo VoteItUp_ExtPath(); ?>/uparrow.png" /></code><br />61 You can use <code><img></code> to use images instead of text. <br>Example: <code><img src="<?php echo VoteItUp_ExtPath(); ?>/uparrow.png" /></code><br /> 62 62 Default: <code>Vote</code> 63 63 </td> … … 67 67 <td> 68 68 <input type="text" name="voteiu_sinktext" class="regular-text" id="voteiu_sinktext" value="<?php echo htmlentities(get_option('voteiu_sinktext')); ?>" <?php if (!GetCurrentSkinInfo('supporttwoway')) { echo 'disabled="disabled" '; }?>/><br /> 69 <?php if (GetCurrentSkinInfo('supporttwoway')) { ?>You can use <code><img></code> to use images instead of text. Example: <code><img src="<?php echo VoteItUp_ExtPath(); ?>/downarrow.png" /></code><br />69 <?php if (GetCurrentSkinInfo('supporttwoway')) { ?>You can use <code><img></code> to use images instead of text. <br>Example: <code><img src="<?php echo VoteItUp_ExtPath(); ?>/downarrow.png" /></code><br /> 70 70 If this is left blank two-way voting is disabled.<?php } else { 71 71 ?>Current widget template does not support two-way voting<?php } ?> … … 76 76 <td> 77 77 <input type="text" name="voteiu_aftervotetext" class="regular-text" id="voteiu_aftervotetext" value="<?php echo htmlentities(get_option('voteiu_aftervotetext')); ?>" /><br /> 78 You can use <code><img></code> to use images instead of text. Text is displayed after user casts a vote. Example: <code><img src="<?php echo VoteItUp_ExtPath(); ?>/disabledarrow.png" /></code><br />78 You can use <code><img></code> to use images instead of text. Text is displayed after user casts a vote. <br>Example: <code><img src="<?php echo VoteItUp_ExtPath(); ?>/disabledarrow.png" /></code><br /> 79 79 If this is left blank the vote button disappears after a vote is cast. 80 80 </td> … … 100 100 <?php SkinsConfig(); ?> 101 101 102 <h3> Widget</h3>102 <h3>Top Post Widget</h3> 103 103 <p>The widget shows posts which have the most votes. Only new posts are considered to keep the list fresh.</p> 104 104 <p>The widget can be displayed to where you want by using the following code: <code><?php MostVotedAllTime(); ?></code>, or if your template supports widgets it can be added via the <a href="widgets.php" title="Widgets">widgets panel</a>.</p> … … 118 118 </table> 119 119 120 <h3>Voting Widget</h3> 121 <?php 122 $options = array("Do not insert automatically", "Insert to top right"); 123 /*$voteiu_insertoption_noinsert = ""; 124 if (get_option('voteiu_autoinsert') == "0") { 125 126 }*/ 127 for ($i = 0; $i < count($options); $i++) { 128 $checkedProperty = ""; 129 if (get_option('voteiu_autoinsert') == "".$i) { 130 $checkedProperty = "checked"; 131 } 132 ?><input type="radio" name="voteiu_autoinsert" id="voteiu_autoinsert" value="<?php echo $i; ?>" <?php echo $checkedProperty; ?> /> <?php echo $options[$i]; ?><br /><?php 133 } 134 135 ?> 136 137 138 <p>If auto-insertion is disabled, the following code should be added in your <code>index.php</code> and <code>single.php</code> theme files to display the voting widget.</p> 139 <p><code><?php DisplayVotes(get_the_ID()); ?></code></p> 140 120 141 <input type="hidden" name="action" value="update" /> 121 <input type="hidden" name="page_options" value="voteiu_initialoffset,voteiu_votetext,voteiu_sinktext,voteiu_aftervotetext,voteiu_allowguests,voteiu_allowownvote,voteiu_limit,voteiu_widgetcount,voteiu_skin" /> 122 123 <h3>Voting code</h3> 124 <p>The following code should be added in your index.php and single.php. This displays the vote buttons.</p> 125 <p><code><?php DisplayVotes(get_the_ID()); ?></code></p> 142 <input type="hidden" name="page_options" value="voteiu_initialoffset,voteiu_votetext,voteiu_sinktext,voteiu_aftervotetext,voteiu_allowguests,voteiu_allowownvote,voteiu_limit,voteiu_widgetcount,voteiu_skin,voteiu_autoinsert" /> 126 143 127 144 <h3>Database</h3> -
vote-it-up/trunk/voteinstall.php
r969632 r969689 17 17 $voteiu_skin = ''; 18 18 $voteiu_initialoffset = 0; 19 $voteiu_autoinsert = "0"; 19 20 20 21 //Begins adding options if not available … … 30 31 add_option('voteiu_dbversion', $voteitup_dbversion, 'Vote It Up db version'); 31 32 add_option('voteiu_initialoffset', $voteiu_initialoffset, 'Vote offset'); 33 add_option('voteiu_autoinsert', $voteiu_autoinsert, 'Insert vote widget automatically'); 32 34 33 35 //Change setting to default values if user left these fields blank -
vote-it-up/trunk/voteitup.css
r969632 r969689 66 66 font-weight: bold; 67 67 } 68 .votewrapper { 69 float: right; 70 margin-left: 10px; 71 margin-bottom: 10px; 72 } -
vote-it-up/trunk/voteitup.php
r969632 r969689 88 88 function MostVotedAllTime($skinname = '', $mode = '') { 89 89 $voteiu_skin = get_option('voteiu_skin'); 90 $ tempvar= $voteiu_skin;90 $currentskin = $voteiu_skin; 91 91 if ($skinname != '') { 92 $tempvar = $skinname; 93 } 94 if ($tempvar == '' || $tempvar == 'default') { 92 $currentskin = $skinname; 93 } 94 $usefallback = false; 95 96 if ($currentskin == '' || $currentskin == 'default') { 97 $usefallback = true; 98 } else if (!LoadSkinWidget($currentskin, $mode)) { // Try to use a theme 99 $usefallback = true; // Theme loading failed 100 } 101 102 // Use the predefined fallback theme 103 if ($usefallback) { 95 104 if ($mode == 'sidebar') { 96 105 MostVotedAllTime_SidebarWidget(); … … 98 107 MostVotedAllTime_Widget(); //Use default bar 99 108 } 100 } else { 101 if (!LoadSkinWidget($tempvar, $mode)) { 102 if ($mode == 'sidebar') { 103 MostVotedAllTime_SidebarWidget(); 104 } else { 105 MostVotedAllTime_Widget(); //Use default bar 106 } 107 } 108 } 109 } 110 109 } 110 } 111 112 $currentPostObject = null; 113 114 function DisplayVotesPrepareHook($postObject) { 115 $currentPostObject = $postObject; 116 return $postObject; 117 } 118 119 function DisplayVotesHook($postContent) { 120 echo "<div class=\"votewrapper\">"; 121 DisplayVotes($postObject->ID); 122 echo "</div>"; 123 return $postContent; 124 } 111 125 112 126 //Display the votes 113 127 function DisplayVotes($postID, $type = '') { 114 128 global $user_ID, $guest_votes, $vote_text, $use_votetext, $allow_sinks, $voteiu_skin; 129 130 $postID = wp_kses($postID, array()); // Sanitize, just in case 115 131 116 132 $voteiu_skin = get_option('voteiu_skin'); … … 118 134 $barvotes = GetBarVotes($postID); 119 135 switch ($type) { 120 case '': // In the event no theme selected, use the default theme136 case '': // In the event no theme selected, use the current theme 121 137 if ($voteiu_skin == '') { 122 DisplayVotes($postID, 'bar');138 return DisplayVotes($postID, 'bar'); 123 139 } else if (!LoadSkin($voteiu_skin)) { 124 DisplayVotes($postID, 'bar');140 return DisplayVotes($postID, 'bar'); 125 141 } 126 142 break; 143 // The following themes below are pre-defined themes in the event there are no other themes found 127 144 case 'bar': 128 145 ?><span class="barcontainer"><span class="barfill" id="votecount<?php echo $postID ?>" style="width:<?php echo round($barvotes[0] * 2.5); ?>%;"> </span></span><?php … … 257 274 add_action('init', 'widget_MostVotedAllTime_init'); 258 275 276 $autoAddVotingCode = false; 277 if (get_option('voteiu_autoinsert') == "1") { 278 $autoAddVotingCode = true; 279 } 280 if ($autoAddVotingCode) { 281 add_action('the_post', 'DisplayVotesPrepareHook'); 282 add_action('the_content', 'DisplayVotesHook'); 283 } 284 259 285 ?>
Note: See TracChangeset
for help on using the changeset viewer.