本文整理汇总了PHP中GDSRHelper类的典型用法代码示例。如果您正苦于以下问题:PHP GDSRHelper类的具体用法?PHP GDSRHelper怎么用?PHP GDSRHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GDSRHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init_categories_data
function init_categories_data()
{
$all_cats = GDSRDatabase::get_all_categories();
$categories = GDSRHelper::get_categories_hierarchy($all_cats);
$ids_array = $items = array();
foreach ($categories as $cat) {
$items[$cat->term_id] = $cat->parent;
$ids_array[] = $cat->term_id;
}
GDSRDatabase::add_category_defaults("(" . join(", ", $ids_array) . ")", $ids_array, $items);
}
示例2:
<?php
$data = gdsrDB::filter_latest_votes($o);
GDSRHelper::render_dash_widget_vote($data);
?>
<div id="gdsr-latest-cmds">
<a class="button" href="admin.php?page=gd-star-rating-stats"><?php
_e("Articles Log", "gd-star-rating");
?>
</a>
<a class="button" href="admin.php?page=gd-star-rating-users"><?php
_e("Users Log", "gd-star-rating");
?>
</a>
</div>
示例3: _e
</tr>
<tr><th scope="row"><?php
_e("Trends Preview", "gd-star-rating");
?>
</th>
<td>
<table cellpadding="0" cellspacing="0">
<tr>
<td width="150" style="padding: 0; border: 0; height: 28px; vertical-align: top;"><?php
_e("Trends", "gd-star-rating");
?>
:</td>
<td width="200" align="left" style="padding: 0; border: 0; vertical-align: top; text-align: right;">
<select style="width: 180px;" name="gdsr_style_preview_trends" id="gdsr_style_preview_trends" onchange="gdsrStyleSelection('trends')">
<?php
GDSRHelper::render_styles_select($gdsr_gfx->trend);
?>
</select>
</td>
<td width="20" style="padding: 0; border: 0; vertical-align: top;" rowspan="2"></td>
<td style="padding: 0; border: 0; vertical-align: top;">
<table cellpadding="0" width="400" cellspacing="0" class="previewtable">
<tr>
<td class="gdsr-preview-trends" style="background-color: black;"><img src="#" id="gdsr_preview_trends_black" /></td>
<td class="gdsr-preview-space"></td>
<td class="gdsr-preview-trends" style="background-color: red;"><img src="#" id="gdsr_preview_trends_red" /></td>
<td class="gdsr-preview-space"></td>
<td class="gdsr-preview-trends" style="background-color: green;"><img src="#" id="gdsr_preview_trends_green" /></td>
<td class="gdsr-preview-space"></td>
<td class="gdsr-preview-trends" style="background-color: white;"><img src="#" id="gdsr_preview_trends_white" /></td>
<td class="gdsr-preview-space"></td>
示例4: _e
?>
</legend>
<table border="0" cellpadding="2" cellspacing="0" width="100%">
<tr>
<td class="gdsrleft"><?php
_e("Set", "gd-star-rating");
?>
:</td>
<td class="gdsrright">
<select id="srRTGStarsStyle" name="srRTGStarsStyle">
<?php
GDSRHelper::render_styles_select($gdsr_styles, 'oxygen');
?>
</select>
</td>
</tr>
<tr>
<td class="gdsrleft"><?php
_e("Size", "gd-star-rating");
?>
:</td>
<td class="gdsrright">
<label><?php
GDSRHelper::render_star_sizes_tinymce("srRTGStarsSize");
?>
</label>
</td>
</tr>
</table>
</fieldset>
示例5: _e
?>
-tv-img" style="display: <?php
echo $instance['trends_voting'] == 'img' ? 'block' : 'none';
?>
">
<table border="0" cellpadding="2" cellspacing="0" width="100%">
<tr>
<td width="100"></td>
<td><?php
_e("Image set", "gd-star-rating");
?>
:</td>
<td align="right">
<select style="width: 180px;" name="<?php
echo $this->get_field_name('trends_voting_set');
?>
" id="<?php
echo $this->get_field_id('trends_voting_set');
?>
">
<?php
GDSRHelper::render_styles_select($wptr, $instance["trends_voting_set"]);
?>
</select>
</td>
</tr>
</table>
</div>
</div>
<div class="gdsr-table-split"></div>
示例6: _e
echo $timer_date_value;
?>
" id="gdsr_timer_date_value" name="gdsr_timer_date_value" style="width: 100px; padding: 2px;" />
</td>
</tr></table>
</div>
<div id="gdsr_timer_countdown" style="display: <?php
echo $timer_restrictions == "T" ? "block" : "none";
?>
">
<table width="<?php
echo $box_width;
?>
"><tr>
<td style="height: 25px;"><label style="font-size: 12px;" for="gdsr_review"><?php
_e("Countdown", "gd-star-rating");
?>
:</label></td>
<td align="right" style="height: 25px;" valign="baseline">
<input type="text" value="<?php
echo $countdown_value;
?>
" id="gdsr_timer_countdown_value" name="gdsr_timer_countdown_value" style="width: 35px; text-align: right; padding: 2px;" />
<?php
GDSRHelper::render_countdown_combo("gdsr_timer_countdown_type", $countdown_type, 60);
?>
</td>
</tr></table>
</div>
<?php
}
示例7: _e
?>
</strong></p>
<div class="tablenav">
<div class="alignleft">
<select style="width: 100px;" name="gdsr_vote" id="gdsr_vote">
<option value="0"<?php
if ($filter_vote == 0) {
echo ' selected="selected"';
}
?>
><?php
_e("All Votes", "gd-star-rating");
?>
</option>
<?php
GDSRHelper::render_stars_select_full($filter_vote, $max_stars, 1, __("Vote", "gd-star-rating"));
?>
</select>
<input class="button-secondary delete" type="submit" name="gdsr_filter" value="<?php
_e("Filter", "gd-star-rating");
?>
" />
</div>
<div class="tablenav-pages">
<?php
echo $pager;
?>
</div>
</div>
<br class="clear"/>
<table class="widefat">
示例8:
?>
:</td>
<td width="80" align="left">
<select style="width: 70px;" name="gdsr_review_stars" id="gdsr_review_stars">
<?php
GDSRHelper::render_stars_select($gdsr_options["review_stars"]);
?>
</select>
</td>
</tr>
<tr>
<td width="150">MSIE 6:</td>
<td width="200" align="left" colspan="6">
<select style="width: 180px;" name="gdsr_review_style_ie6" id="gdsr_review_style_ie6">
<?php
GDSRHelper::render_styles_select($gdsr_gfx->stars, $gdsr_options["review_style_ie6"]);
?>
</select>
</td>
</tr>
</table>
<div class="gdsr-table-split"></div>
<table cellpadding="0" cellspacing="0" class="previewtable">
<tr>
<td width="150"><?php
_e("Rating header", "gd-star-rating");
?>
:</td>
<td width="200">
<input type="text" name="gdsr_review_header_text" id="gdsr_review_header_text" value="<?php
echo wp_specialchars($gdsr_options["review_header_text"]);
示例9: jQuery
?>
};
var gdsrTrendsExt = { <?php
GDSRHelper::render_ext_gfx_js($gdsr_gfx->trend);
?>
};
var gdsrThumbsExt = { <?php
GDSRHelper::render_ext_gfx_js($gdsr_gfx->thumbs);
?>
};
var gdsrAuthors = { <?php
GDSRHelper::render_authors_gfx_js($gdsr_gfx->stars);
?>
};
var gdsrAuthorsThumbs = { <?php
GDSRHelper::render_authors_gfx_js($gdsr_gfx->thumbs);
?>
};
var gdsrBase = "#gdsr_preview";
var gdsrStyle = "";
var gdsrSize = "";
var gdsrImage = "";
if (preview == "trends") {
gdsrBase = gdsrBase + "_trends";
gdsrStyle = jQuery("#gdsr_style_preview_trends").val();
gdsrImage = gdsrTrends[gdsrStyle] + "trend." + gdsrTrendsExt[gdsrStyle];
} else if (preview == "thumbs") {
gdsrBase = gdsrBase + "_thumbs";
gdsrSize = jQuery("#gdsr_size_preview_thumbs").val();
示例10: _e
<tr>
<td width="150"><?php
_e("Thumbs", "gd-star-rating");
?>
:</td>
<td width="200" align="left">
<select style="width: 180px;" name="gdsr_thumb_rss_style" id="gdsr_thumb_rss_style">
<?php
GDSRHelper::render_styles_select($gdsr_gfx->thumbs, $gdsr_options["thumb_rss_style"]);
?>
</select>
</td>
<td width="10"></td>
<td width="150" align="left">
<?php
GDSRHelper::render_thumbs_sizes("gdsr_thumb_rss_size", $gdsr_options["thumb_rss_size"]);
?>
</td>
</tr>
</table>
<div class="gdsr-table-split"></div>
<table cellpadding="0" cellspacing="0" class="previewtable">
<tr>
<td width="150"><?php
_e("Rating Header", "gd-star-rating");
?>
:</td>
<td><input type="text" name="gdsr_rss_header_text" id="gdsr_rss_header_text" value="<?php
echo esc_attr($gdsr_options["rss_header_text"]);
?>
" style="width: 350px" /></td>
示例11: _e
')"><?php
_e("Stars", "gd-star-rating");
?>
</a></strong></td>
<td width="100" nowrap="nowrap"><?php
_e("Set", "gd-star-rating");
?>
:</td>
<td align="right"><select style="width: 200px" name="<?php
echo $wpfn;
?>
[rating_stars]"><?php
GDSRHelper::render_styles_select($wpst, $wpno['rating_stars']);
?>
</select></td>
</tr>
<tr>
<td width="100" valign="top"></td>
<td width="100" nowrap="nowrap"><?php
_e("Size", "gd-star-rating");
?>
:</td>
<td align="right"><?php
GDSRHelper::render_star_sizes($wpfn . "[rating_size]", $wpno['rating_size'], 200);
?>
</td>
</tr>
</table>
</div>
<div class="gdsr-table-split"></div>
示例12: render_multi_rating
function render_multi_rating($post, $user, $settings)
{
if ($this->is_bot) {
return "";
}
if (is_feed()) {
return "";
}
$set = gd_get_multi_set($settings["id"]);
if ($set == null) {
return "";
}
$dbg_allow = "F";
$allow_vote = true;
if ($this->is_ban && $this->o["ip_filtering"] == 1) {
if ($this->o["ip_filtering_restrictive"] == 1) {
return "";
} else {
$allow_vote = false;
}
$dbg_allow = "B";
}
if ($settings["read_only"] == 1) {
$dbg_allow = "RO";
$allow_vote = false;
}
if (is_single() || is_page() && $this->o["display_comment_page"] == 1) {
$this->init_post();
}
$rd_post_id = intval($post->ID);
$rd_user_id = intval($user->ID);
$rd_is_page = $post->post_type == "page" ? "1" : "0";
$remaining = 0;
$deadline = "";
if ($this->p) {
$post_data = $this->p;
} else {
$post_data = GDSRDatabase::get_post_data($rd_post_id);
if (count($post_data) == 0) {
GDSRDatabase::add_default_vote($rd_post_id, $rd_is_page);
$post_data = GDSRDatabase::get_post_data($rd_post_id);
}
}
if ($post_data->rules_articles == "H") {
return "";
}
if ($allow_vote) {
if ($this->o["author_vote"] == 1 && $rd_user_id == $post->post_author) {
$allow_vote = false;
$dbg_allow = "A";
}
}
if ($allow_vote) {
if ($post_data->rules_articles == "" || $post_data->rules_articles == "A" || $post_data->rules_articles == "U" && $rd_user_id > 0 || $post_data->rules_articles == "V" && $rd_user_id == 0) {
$allow_vote = true;
} else {
$allow_vote = false;
$dbg_allow = "R_" . $post_data->rules_articles;
}
}
if ($allow_vote && ($post_data->expiry_type == 'D' || $post_data->expiry_type == 'T')) {
switch ($post_data->expiry_type) {
case "D":
$remaining = GDSRHelper::expiration_date($post_data->expiry_value);
$deadline = $post_data->expiry_value;
break;
case "T":
$remaining = GDSRHelper::expiration_countdown($post->post_date, $post_data->expiry_value);
$deadline = GDSRHelper::calculate_deadline($remaining);
break;
}
if ($remaining < 1) {
GDSRDatabase::lock_post($rd_post_id);
$allow_vote = false;
$dbg_allow = "T";
}
}
if ($allow_vote) {
$allow_vote = GDSRDBMulti::check_vote($rd_post_id, $rd_user_id, $set->multi_id, 'multis', $_SERVER["REMOTE_ADDR"], $this->o["logged"] != 1, $this->o["mur_allow_mixed_ip_votes"] == 1);
if (!$allow_vote) {
$dbg_allow = "D";
}
}
if ($allow_vote) {
$allow_vote = $this->check_cookie($rd_post_id . "#" . $set->multi_id, "multis");
if (!$allow_vote) {
$dbg_allow = "C";
}
}
$multi_record_id = GDSRDBMulti::get_vote($rd_post_id, $set->multi_id, count($set->object));
$multi_data = GDSRDBMulti::get_values($multi_record_id);
$votes = array();
foreach ($multi_data as $md) {
$single_vote = array();
$single_vote["votes"] = 0;
$single_vote["score"] = 0;
if ($post_data->rules_articles == "A" || $post_data->rules_articles == "N") {
$single_vote["votes"] = $md->user_voters + $md->visitor_voters;
$single_vote["score"] = $md->user_votes + $md->visitor_votes;
} else {
//.........这里部分代码省略.........
示例13: _e
</td>
</tr>
</table>
<div id="<?php
echo $this->get_field_id('source');
?>
-multis" style="display: <?php
echo $instance['source'] == 'multis' ? 'block' : 'none';
?>
">
<table border="0" cellpadding="2" cellspacing="0" width="100%">
<tr>
<td width="140" nowrap="nowrap"><?php
_e("Multi Set", "gd-star-rating");
?>
:</td>
<td align="right"><select name="<?php
echo $this->get_field_name('source_set');
?>
" id="<?php
echo $this->get_field_id('source_set');
?>
" style="width: 200px"><?php
GDSRHelper::render_styles_select($wpml, $instance['source_set']);
?>
</select></td>
</tr>
</table>
</div>
<div class="gdsr-table-split"></div>
示例14: get_categories_hierarchy
function get_categories_hierarchy($cats, $depth = 0, $level = 0)
{
$h = array();
foreach ($cats as $cat) {
if ($cat->parent == $level) {
$cat->depth = $depth;
$h[] = $cat;
$recats = GDSRHelper::get_categories_hierarchy($cats, $depth + 1, $cat->term_id);
$h = array_merge($h, $recats);
}
}
return $h;
}
示例15: _e
</label>
</td>
</tr>
<tr><th scope="row"><?php
_e("Vote Waiting Message", "gd-star-rating");
?>
</th>
<td>
<table cellpadding="0" cellspacing="0" class="previewtable">
<tr>
<td width="150"><?php
_e("Animation indicator", "gd-star-rating");
?>
:</td>
<td width="200"><?php
GDSRHelper::render_loaders("gdsr_wait_loader_multis", $gdsr_options["wait_loader_multis"], 'jqloadermultis');
?>
</td>
<td width="10"></td>
<td rowspan="3" width="150" valign="top"><?php
_e("Preview", "gd-star-rating");
?>
:</td>
<td rowspan="3" valign="top">
<div class="wait-preview-article">
<div id="gdsrwaitpreviewmultis" class="<?php
echo $default_preview_class;
?>
">
<?php
if ($gdsr_options["wait_show_multis"] == 0) {