Ceviz Forum

Geri Dön   Ceviz Forum > Web & Grafik > Web Tasarım

Cevapla
 
LinkBack Seçenekler
Eski 05/05/2007, 09:51   #1 (permalink)
İptal Durumu
 
Üyelik Tarihi: 05/2007
Mesaj: 2
Uyarı vbulletin için .xml kod yardım!

Vbulletin tabanli sitem için "anasayfada anket(polls in forumhome)" eklentisi kurdum. Ancak eklenti yalnız anket sonuçlarını anasayfada gösteriyor.

Anasayfadan oy kullanılmasını ve oy kullananlara sadece anket sonuçlarının gösterilmesini veya oy kullandığı anketin o üyeye bir daha görünmemesini (anasayfada) istiyorum.

XML dosyasının kodlaması aşağıdaki şekildedir:

PHP Kodu:
<?xml version="1.0" encoding="ISO-8859-1"?>
<product productid="devel_poll" active="1">
 <title>Show poll(s) in forumhome</title>
 <description>Developer</description>
 <version>1.0.0</version>
 <apm_releasedate>1143612000</apm_releasedate>
 <apm_author>Developer</apm_author>
 <apm_relatedurl />
 <apm_extrainfo />
 <apm_extraedit />
 <codes>
 </codes>
 <templates>
 </templates>
 <plugins>
  <plugin active="1">
   <title>Cache Templates</title>
   <hookname>cache_templates</hookname>
   <phpcode><![CDATA[if (THIS_SCRIPT == 'index')
{
 $globaltemplates = array_merge($globaltemplates, array('polloptions_table', 'polloption', 'polloption_multiple', 'pollresult', 'pollresults_table'));
}]]></phpcode>
  </plugin>
  <plugin active="1">
   <title>main code</title>
   <hookname>forumhome_start</hookname>
   <phpcode><![CDATA[if ($vbulletin->options['devel_poll_onoff'])
{
    switch ($vbulletin->options['devel_poll_ord'])
 {
 case 0: $ord = 'RAND()'; break;
 case 1: $ord = 'poll.dateline'; break;
    case 2: $ord = 'voters'; break;
    case 3: $ord = 'lastvote'; break;
    }
    $poll = '';
 $pollbits = '';
 $counter = 1;
 $pollid = $vbulletin->options['devel_poll_id'];
 $pollinfo = $db->query_first("
  SELECT thread.pollid, open, threadid, replycount, forumid, question, poll.dateline, options, votes, active, numberoptions, timeout, multiple, voters, public
  FROM " . TABLE_PREFIX . "poll AS poll
  INNER JOIN " . TABLE_PREFIX . "thread AS thread USING (pollid)
  WHERE thread.threadid IN ($pollid)
        ORDER BY $ord DESC
        LIMIT 1
 ");
 require_once(DIR . '/includes/class_bbcode.php');
    $parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
 $pollinfo['question'] = $parser->do_parse($pollinfo['question'], 0, 1, 1, 1, 1);
    $pollinfo['option'] = $parser->do_parse($pollinfo['option'], 0, 1, 1, 1, 1);
    
 $splitoptions = explode('|||', $pollinfo['options']);
 $splitvotes = explode('|||', $pollinfo['votes']);
 $showresults = 0;
 $uservoted = 0;
 if (!$pollinfo['active'] OR ($pollinfo['dateline'] + ($pollinfo['timeout'] * 86400) < TIMENOW AND $pollinfo['timeout'] != 0))
 {
  $showresults = 1;
 }
 else
 {
  $voted = intval(fetch_bbarray_cookie('poll_voted', $pollid));
  if ($voted)
  {
   $uservoted = 1;
  }
 }

 if ($vbulletin->userinfo['userid'] > 0 AND $pollinfo['numbervotes'] > 0)
 {
  $pollvotes = $db->query_read("
   SELECT voteoption
   FROM " . TABLE_PREFIX . "pollvote
            INNER JOIN " . TABLE_PREFIX . "thread AS thread USING (pollid)
   WHERE userid = " . $vbulletin->userinfo['userid'] . " AND thread.threadid IN ($pollid)
  ");
  if ($db->num_rows($pollvotes) > 0)
  {
   $uservoted = 1;
  }
 }
 if ($showresults OR $uservoted)
 {
        if ($vbulletin->options['devel_poll_dis'])
  {
         arsort($splitvotes);
  }
     if ($uservoted)
  {
   $uservote = array();
   while ($pollvote = $db->fetch_array($pollvotes))
   {
    $uservote["$pollvote[voteoption]"] = 1;
   }
  }
 }
 $option['open'] = $stylevar['left'][0];
 $option['close'] = $stylevar['right'][0];
 foreach ($splitvotes AS $index => $value)
 {
  $arrayindex = $index + 1;
  $option['uservote'] = iif($uservote["$arrayindex"], true, false);
  $option['question'] = $parser->do_parse($splitoptions["$index"], $forum['forumid'], true);
  if ($pollinfo['public'] AND $value)
  {
   $option['votes'] = '<a href="poll.php?' . $vbulletin->session->vars['sessionurl'] . 'do=showresults&amp;pollid=' . $pollinfo['pollid'] . '">' . $value . '</a>';
  }
  else
  {
   $option['votes'] = $value;
  }
  $option['number'] = $counter;
  if ($showresults OR $uservoted)
  {
   if ($value <= 0)
   {
    $option['percent'] = 0;
   }
   else if ($pollinfo['multiple'])
   {
    $option['percent'] = vb_number_format(($value < $pollinfo['voters']) ? $value / $pollinfo['voters'] * 100 : 100, 2);
   }
   else
   {
    $option['percent'] = vb_number_format(($value < $pollinfo['numbervotes']) ? $value / $pollinfo['numbervotes'] * 100 : 100, 2);
   }
   $option['graphicnumber'] = $option['number'] % 6 + 1;
   $option['barnumber'] = round($option['percent']) * 2;
   if ($nopermission)
   {
    $pollstatus = $vbphrase['you_may_not_vote_on_this_poll'];
   }
   else if ($showresults)
   {
    $pollstatus = $vbphrase['this_poll_is_closed'];
   }
   else if ($uservoted)
   {
    $pollstatus = $vbphrase['you_have_already_voted_on_this_poll'];
   }
   eval('$pollbits .= "' . fetch_template('pollresult') . '";');
  }
  else
  {
   if ($pollinfo['multiple'])
   {
    eval('$pollbits .= "' . fetch_template('polloption_multiple') . '";');
   }
   else
   {
    eval('$pollbits .= "' . fetch_template('polloption') . '";');
   }
  }
  $counter++;
 }
 if ($pollinfo['multiple'])
 {
  $pollinfo['numbervotes'] = $pollinfo['voters'];
  $show['multiple'] = true;
 }
 if ($pollinfo['public'])
 {
  $show['publicwarning'] = true;
 }
 else
 {
  $show['publicwarning'] = false;
 }

 if ($showresults OR $uservoted)
 {
  eval('$poll = "' . fetch_template('pollresults_table') . '";');
 }
 else
 {
  eval('$poll = "' . fetch_template('polloptions_table') . '";');
 }
 $search = '$navbar';
    $replace = '$poll';
 $vbulletin->templatecache['FORUMHOME'] = str_replace($search,
 $search.$replace,$vbulletin->templatecache['FORUMHOME']);
}]]></phpcode>
  </plugin>
 </plugins>
 <phrases>
  <phrasetype name="vBulletin Settings" fieldname="vbsettings">
   <phrase name="setting_devel_poll_dis_desc"><![CDATA[If you choose yes poll options will be displayed according to vote percent ((this will happen if the poll closed or the user had voted))]]></phrase>
   <phrase name="setting_devel_poll_dis_title"><![CDATA[Display poll options according to vote percent?]]></phrase>
   <phrase name="setting_devel_poll_id_desc"><![CDATA[Put thread(s) id(s) here seprating them by comma]]></phrase>
   <phrase name="setting_devel_poll_id_title"><![CDATA[Thread(s) id(s)]]></phrase>
   <phrase name="setting_devel_poll_onoff_desc"><![CDATA[If you choose yes poll(s) will appears in forumhome]]></phrase>
   <phrase name="setting_devel_poll_onoff_title"><![CDATA[Enable the hack?]]></phrase>
   <phrase name="setting_devel_poll_ord_desc"><![CDATA[If you had put more than one thread ids, u could choose the display order of them]]></phrase>
   <phrase name="setting_devel_poll_ord_title"><![CDATA[Poll display order]]></phrase>
   <phrase name="settinggroup_devel_poll"><![CDATA[Show poll(s) in forumhome]]></phrase>
  </phrasetype>
 </phrases>
 <options>
  <settinggroup name="devel_poll" displayorder="65535">
   <setting varname="devel_poll_onoff" displayorder="10">
    <datatype>number</datatype>
    <optioncode>yesno</optioncode>
    <defaultvalue>0</defaultvalue>
   </setting>
   <setting varname="devel_poll_id" displayorder="20">
    <datatype>free</datatype>
    <defaultvalue>0</defaultvalue>
   </setting>
   <setting varname="devel_poll_ord" displayorder="30">
    <datatype>free</datatype>
    <optioncode><![CDATA[<select name=\"setting[$setting[varname]]\" tabindex=\"1\" class=\"bginput\">
<option value=\"0\" " . iif($setting['value']==0,'selected="selected"') . ">Randomly</option>
<option value=\"1\" " . iif($setting['value']==1,'selected="selected"') . ">Dateline</option>
<option value=\"2\" " . iif($setting['value']==2,'selected="selected"') . ">Voters number</option>
<option value=\"3\" " . iif($setting['value']==3,'selected="selected"') . ">Last vote date</option>
</select>]]></optioncode>
    <defaultvalue>1</defaultvalue>
   </setting>
   <setting varname="devel_poll_dis" displayorder="40">
    <datatype>number</datatype>
    <optioncode>yesno</optioncode>
    <defaultvalue>1</defaultvalue>
   </setting>
  </settinggroup>
 </options>
</product>
Bu kodlamada ne gibi değişiklikler yapmam gerekiyor?

Yardımlarınız için şimdiden teşekkürler...
srkn7 hatta değil   Alıntı Yaparak Yanıtla
Cevapla

Bookmarks

Seçenekler

Mesaj Yazma Hakları
Yeni mesajgöndermezsiniz
Cevap yazamazsınız
Dosya ekleyemezsiniz
Mesajınızı düzenleyemezsiniz

BB code is Açık
[IMG] kodu Açık
HTML kodu Kapalı
Trackbacks are Açık
Pingbacks are Açık
Refbacks are Açık

Benzer Konular
Konu Konuyu açana göre Forum Cevap En Son Mesaj
Vbulletin için ajax problemi thelastmercy Javascript / DHTML / Ajax 6 06/04/2007 11:06
Video sitesi için gerekli programlar ( ama windows için ) liste içeride yardım lütfen kuaza Web Tasarım 11 20/02/2007 18:45
Vbulletin Tarzı Forum sistemi yazıyorum Fikirleriniz benim için önemli not:found PHP 41 02/11/2006 21:57
vBulletin & PHP Bilenler Lütfen Yardım x-treme Uygulama Yazılımları / Hazır Betikler 2 16/03/2006 20:41
vbulletin yardım ekselans12 Uygulama Yazılımları / Hazır Betikler 18 13/07/2004 01:13


Forum saati Türkiye saatine göredir. GMT +3. Şu anda saat 08:59.

Reklamlar & Desteklenenler
Hassas Valf | Hassas Kaplama | Antalyamız | Gazete | Ticari Bilişim | Hakan Müştak | Rüya Tabirleri | Kadın | Hastalıklar | Cepte msn ve e-posta | Webmaster | Antalya Aupair | Turkish Property Antalya | Forum | Chat | Perde | Adsl | Araba | bolindir.com | guncelle.com | livescore | Web Tasarım | evden eve nakliyat | forum | evden eve | sohbet | Resimcim| Kalifiye İnsan Kaynakları | Web Tasarım | Oyun | Yusuf KOÇ | Akın Yorulmaz | şiir | UFO | Web Tasarım | Oyunlar | Canlı Tv | Malta |


Forum Yazılımı: vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright ©2001 - 2008, Ceviz.net