dsen53898 2013-06-12 21:10
浏览 36
已采纳

GD Star Rating插件:更改动态级联样式表

I’m in the midst of creating a page that allows users to vote for one of two competing images. I’ve used the GD Star Rating plug-in for WordPress in the past, but am struggling with altering the output in accordance to my specifications. Ideally I would like to eliminate the thumbs down option, so users will only be presented with the thumbs up option for both of the images. It appears that the CSS style code is created dynamically through PHP. Assuming that this is what it is called. Typically I would merely alter the CSS code and comment out the section that outputs the thumbs down image, but I’m not entirely sure what to do in this case. I’ve tried to comment out the lines that deal with the thumbs down CSS (i.e., gdthumb.gddw), but it doesn’t appear to have an effect. Ideas?

<?php
if (count($thumb_sets) > 0 && count($thumb_sizes)) {
foreach ($thumb_sizes as $size) {
    echo sprintf(".gdt-size-%s.gdthumbtext { line-height: %spx; }
", $size, $size);
    echo sprintf(".gdt-size-%s.gdthumb, .gdt-size-%s.gdthumb a, .gdt-size-%s.gdthumb div { width: %spx; height: %spx; }
", $size, $size, $size, $size, $size);
    echo sprintf(".gdt-size-%s.gdthumb.gddw a, .gdt-size-%s.gdthumb.gddw div { background-position: 0px -%spx !important; }
", $size, $size, $size);
    echo sprintf(".gdt-size-%s.gdthumb.gdup a:hover { background-position: 0px -%spx; }
", $size, 2 * $size);
    echo sprintf(".gdt-size-%s.gdthumb.gddw a:hover { background-position: 0px -%spx !important; }
", $size, 3 * $size);
    foreach ($thumb_sets as $set) {
        $url = ($set["location"] == 1 ? $base_url_local : $base_url_extra)."thumbs/".$set["folder"]."/thumbs".$size.".".$set["type"];
        echo sprintf(".gdt-size-%s.gdthumb a.gdt-%s, .gdt-size-%s.gdthumb div.gdt-%s { background: url('%s') no-repeat; }
", $size, $set["folder"], $size, $set["folder"], $url);
    }
}
}

?>

Related HTML

<div id = "rateA" style="width:285px; float:left">
<div style="display: none">VA:F [1.9.22_1171]</div>
<div class="thumblock "><div id="gdsr_thumb_288_a_up" class="gdt-size-40 gdthumb gdup">
<a id="gdsrX288XupXaX25X40XY" class="gdt-starrating" rel="nofollow"></a></div>
<div id="gdsr_thumb_288_a_loader_up" style="display: none; width: 40px " class="ratingloader loadup">
<div class="loader flower thumb" style="width: 40px; height: 40px;"></div></div>
<div id="gdsr_thumb_288_a_dw" class="gdt-size-40 gdthumb gddw">
<a id="gdsrX288XdwXaX25X40XY" class="gdt-starrating" rel="nofollow"></a></div>
<div id="gdsr_thumb_288_a_loader_dw" style="display: none; width: 40px " class="ratingloader loaddw">
<div class="loader flower thumb" style="width: 40px; height: 40px;"></div></div>
<div class="ratingtext ">
<div id="gdsr_thumb_text_288_a" class="gdt-size-40 gdthumbtext">Rating: <strong>0</strong> (from 0 votes)</div></div><div class="raterclear"></div></div>

Generated CSS

.gdt-size-40.gdthumb, .gdt-size-40.gdthumb a, .gdt-size-40.gdthumb div {
height: 40px;
width: 40px;
}

.gdthumb {
float: left;
position: relative;
}
  • 写回答

1条回答 默认 最新

  • dow72046 2013-06-18 06:53
    关注

    In order to remove the thumb images (i.e., Thumbs Up or Thumbs Down) you should alter the render.php file. I was unable to accomplish this task when merely changing the PHP file that dynamically creates the CSS.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 fluent的在模拟压强时使用希望得到一些建议
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 Web.config连不上数据库
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退