Post-Star-Rating

From The Lyceum Wiki

Jump to: navigation, search

Edits required for basic functionality (multi-blog setup not yet tried):

  • include paths
  • image locations

The dbDelta WP function must also be included in /lib/wp-admin/upgrade-functions.php It was removed as it was not used (for more info see changeset 670). Use at your own risk!!!


diff -ru post-star-rating-v.0.3/install.php post-star-rating/install.php
--- post-star-rating-v.0.3/install.php	2006-02-07 01:14:00.000000000 +0000
+++ post-star-rating/install.php	2006-11-21 12:45:24.000000000 +0000
@@ -1,5 +1,6 @@
 <?php
-require_once('../../../wp-config.php');
+require('../../../private.php');
+require_once(PRIVATEROOT . 'config/wp-config.php');
 require_once('psr.class.php');
 ?>
 <pre>
diff -ru post-star-rating-v.0.3/psr-ajax-stars.php post-star-rating/psr-ajax-stars.php
--- post-star-rating-v.0.3/psr-ajax-stars.php	2006-04-06 23:08:00.000000000 +0100
+++ post-star-rating/psr-ajax-stars.php	2006-11-21 12:45:24.000000000 +0000
@@ -1,5 +1,6 @@
 <?php
-require_once('../../../wp-config.php');
+require('../../../private.php');
+require_once(PRIVATEROOT . 'config/wp-config.php');
 require_once('psr.class.php');
 $id = $_REQUEST['p'];
 $PSR =& new PSR();
diff -ru post-star-rating-v.0.3/psr.class.php post-star-rating/psr.class.php
--- post-star-rating-v.0.3/psr.class.php	2006-04-21 00:41:00.000000000 +0100
+++ post-star-rating/psr.class.php	2006-11-21 12:45:24.000000000 +0000
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * Class that manages all the features of Post Star Rating Wordpress plugin
  *
@@ -25,7 +26,7 @@
 			  PRIMARY KEY (ID)
 			);";
 
-			require_once(ABSPATH . 'wp-admin/upgrade-functions.php');
+      require_once(PRIVATEROOT . 'lib/wp-admin/upgrade-functions.php');
 			dbDelta($sql);
 			if ($echo) _e("Se ha creado la tabla de valoraci�n\n");
 		} else {
@@ -43,7 +44,7 @@
 			  PRIMARY KEY (`user`,post),
 			  KEY vote_date (vote_date)
   		);";
-			require_once(ABSPATH . 'wp-admin/upgrade-functions.php');
+			require_once(PRIVATEROOT . 'lib/wp-admin/upgrade-functions.php');
 			dbDelta($sql);
 			if ($echo) _e("Se ha creado la tabla de puntuaciones\n");
 		} elseif (!$wpdb->get_row("SHOW COLUMNS FROM {$table_name} LIKE 'vote_date'")) {
@@ -141,7 +142,7 @@
 			}
 			$html .= '<span class="' . $class . '">' . $char . '</span> ';
 		}
-		$html .= '<span class="PSR_votes">' . (int) $votes . '</span> <span class="PSR_tvotes">' . __('votos') . '</span>';
+		$html .= '<span class="PSR_votes">' . (int) $votes . '</span> <span class="PSR_tvotes">' . __('votes') . '</span>';
 		$html .= '</div></div>';
 		return $html;
 	}
@@ -174,7 +175,7 @@
 			}
 			$html .= sprintf('<input type="radio" id="psr_star_%1$d_%2$d" class="star" name="psr_stars" value="%2$d" onclick="PSR_save_vote(%1$d,%2$d)" /><label class="%3$s" for="psr_star_%1$d_%2$d" onmouseover="PSR_star_over(this, %2$d)">%2$d</label> ', $id, $i, $class);
 		}
-		$html .= '<span class="PSR_votes">' . (int) $votes . '</span> <span class="PSR_tvotes">' . __('votos') . '</span> <span class="PSR_tvote">' . __('Vota!!') . '</span>';
+		$html .= '<span class="PSR_votes">' . (int) $votes . '</span> <span class="PSR_tvotes">' . __('votes') . '</span>';
 		$html .= '<input type="hidden" name="p" value="' . $id . '" />';
 		$html .= '<input type="submit" name="vote" value="' . __('Votar') . '" />';
 		$html .= '</form></div>';
@@ -407,22 +408,22 @@
 		  background-repeat: no-repeat;
 		}
 		.PSR_no_star {
-		  background-image: url(" . $home . "/wp-content/plugins/post-star-rating/img/stars/no_star.gif);
+		  background-image: url(" . WEBROOT . "/wp-content/plugins/post-star-rating/img/stars/no_star.gif);
 		}
 		.PSR_full_star {
-		  background-image: url(" . $home . "/wp-content/plugins/post-star-rating/img/stars/full_star.gif);
+		  background-image: url(" . WEBROOT . "/wp-content/plugins/post-star-rating/img/stars/full_star.gif);
 		}
 		.PSR_half_star {
-		  background-image: url(" . $home . "/wp-content/plugins/post-star-rating/img/stars/half_star.gif);
+		  background-image: url(" . WEBROOT . "/wp-content/plugins/post-star-rating/img/stars/half_star.gif);
 		}
 		.PSR_no_voting_star {
-		  background-image: url(" . $home . "/wp-content/plugins/post-star-rating/img/stars/no_star.gif);
+		  background-image: url(" . WEBROOT . "/wp-content/plugins/post-star-rating/img/stars/no_star.gif);
 		}
 		.PSR_full_voting_star {
-		  background-image: url(" . $home . "/wp-content/plugins/post-star-rating/img/stars/full_voting_star.gif);
+		  background-image: url(" . WEBROOT . "/wp-content/plugins/post-star-rating/img/stars/full_voting_star.gif);
 		}
 		.PSR_half_voting_star {
-		  background-image: url(" . $home . "/wp-content/plugins/post-star-rating/img/stars/half_voting_star.gif);
+		  background-image: url(" . WEBROOT . "/wp-content/plugins/post-star-rating/img/stars/half_voting_star.gif);
 		}
 		.PSR_votes {
 			padding-left: .5em;
@@ -446,13 +447,13 @@
 			margin-right: .5em;
 		}
 		.PSR_moment_scores .trend_up {
-		  background-image: url(" . $home . "/wp-content/plugins/post-star-rating/img/stars/up_arrow.gif);
+		  background-image: url(" . WEBROOT . "/wp-content/plugins/post-star-rating/img/stars/up_arrow.gif);
 		}
 		.PSR_moment_scores .trend_dw {
-		  background-image: url(" . $home . "/wp-content/plugins/post-star-rating/img/stars/dw_arrow.gif);
+		  background-image: url(" . WEBROOT . "/wp-content/plugins/post-star-rating/img/stars/dw_arrow.gif);
 		}
 		.PSR_moment_scores .trend_eq {
-		  background-image: url(" . $home . "/wp-content/plugins/post-star-rating/img/stars/eq_arrow.gif);
+		  background-image: url(" . WEBROOT . "/wp-content/plugins/post-star-rating/img/stars/eq_arrow.gif);
 		}
 		.PSR_moment_scores .PSR_container {
 			position: absolute;
@@ -519,7 +520,7 @@
 		function PSR_save_vote(post, points) {
 		  if (!PSR_isWorking) {
 		  	PSR_current_post=post;
-				PSR_http.open('GET', '" . get_settings('home') . "/wp-content/plugins/post-star-rating/psr-ajax-stars.php?p=' + PSR_current_post + '&psr_stars=' + points, true); 
+				PSR_http.open('GET', '" . WEBROOT . "/wp-content/plugins/post-star-rating/psr-ajax-stars.php?p=' + PSR_current_post + '&psr_stars=' + points, true); 
 				PSR_http.onreadystatechange = PSR_update_vote; 
 			 	PSR_isWorking = true;
 				PSR_http.send(null);
Personal tools