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 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料