投票モジュール。XOOPSの標準モジュールだが、ログの閲覧が出来ないなど、少し使い勝手が悪いので、改造してみる。



wellwineさんの改造版 anchor.png

http://wellwine.net/modules/mydownloads/singlefile.php?cid=6&lid=19

  • 少し古い。更新はされていない様子。
  • 多分そのままインストールしても大丈夫。
Page Top

XOOPS Cube公式サイトのフォーラムより anchor.png

  • 投票モジュールの説明文について
    ●改造箇所(XOOPS 2.0.6の場合)
    [1]
    /html/modules/xoopspoll/class/xoopspollrenderer.php 83行目の
    -----------------------------------------------------------
    $tpl->assign('poll', array('question' => $this->poll->getVar("question"), 
     'pollId' => $this->poll->getVar("poll_id"), 'viewresults' => 
     XOOPS_URL."/modules/xoopspoll/pollresults.php?poll_id=".
     $this->poll->getVar("poll_id"), 'action' => 
     XOOPS_URL."/modules/xoopspoll/index.php", 'options' => $options));
    -----------------------------------------------------------
    を
    -----------------------------------------------------------
    $tpl->assign('poll', array('question' => $this->poll->getVar("question"), 
     'desc' => $this->poll->getVar("description"), 'pollId' => 
     $this->poll->getVar("poll_id"), 'viewresults' => 
     XOOPS_URL."/modules/xoopspoll/pollresults.php?poll_id=".
     $this->poll->getVar("poll_id"), 'action' => 
     XOOPS_URL."/modules/xoopspoll/index.php", 'options' => $options));
    -----------------------------------------------------------
    に変更。
    [2]
    同じファイルの148行目の
    -----------------------------------------------------------
    $tpl->assign('poll', array('question' => 
     $this->poll->getVar("question"),'end_text' => $end_text,'totalVotes' => 
     sprintf(_PL_TOTALVOTES, $total), 'totalVoters' => sprintf(_PL_TOTALVOTERS, 
     $this->poll->getVar("voters")),'vote' => $vote, 'options' => $options));
    -----------------------------------------------------------
    を
    -----------------------------------------------------------
    $tpl->assign('poll', array('question' => $this->poll->getVar("question"),
     'desc' => $this->poll->getVar("description"),'end_text' => 
     $end_text,'totalVotes' => sprintf(_PL_TOTALVOTES, $total), 'totalVoters' => 
     sprintf(_PL_TOTALVOTERS, $this->poll->getVar("voters")),'vote' => $vote, 
     'options' => $options));
    -----------------------------------------------------------
    に書き換え。
    
    これで、テンプレートセット・マネジャーで「xoopspoll_view.html」と
    「xoopspoll_results.html」のファイルに<{$poll.desc}>のタグを書き加えて保存すれ
    ば、説明文も表示されるようになります。

新しくコメントをつける

題名
ゲスト名   :
投稿本文
より詳細なコメント入力フォームへ

コメント一覧


Front page   Freeze Diff Backup Copy Rename ReloadPrint View   New Page Page list Search Recent changes   Help   RSS of recent changes (RSS 1.0) RSS of recent changes (RSS 2.0) RSS of recent changes (RSS Atom) Powered by xpWiki
Counter: 1447, today: 2, yesterday: 1
Princeps date: 2008-05-11 (Sun) 02:45:37
Last-modified: 2008-05-11 (Sun) 03:45:37 (JST) (1366d) by gokuraku

ログイン

ユーザ名:

パスワード:



パスワード紛失

新規登録

ad by google