vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   vbHome (lite) - your vBulletin(powered) main homepage (https://vborg.vbsupport.ru/showthread.php?t=36756)

212rikanmofo 04-22-2002 08:33 AM

how can i add that scrolling top 10 thread list like on one of the guy's site on here? can you show me please...

FleaBag 04-24-2002 04:02 PM

Quote:

Originally posted by 212rikanmofo
i just wanna know is it possible to rename my current index.php to index.bak b4 i install this hack? just incase i want to revert back? is there an uninstall feature for this hack?
Yes it is, I did so myself.

FleaBag 04-24-2002 04:04 PM

Quote:

Originally posted by Emma
another question, I wasn't sure if this was the place to post it since it involves another hack too, but it I am in the wrong place forgive me :)

My question is I have a shoutbox already installed on my site. But I wanted to move it into a small table on a page where I have vbhome installed. How do I do this? I wasn't sure what part of the code needs to be copied over into the index file and so forth.

Thanks!
Emma

You could use iframes, there is more information on this in the actual shoutbox thread.

212rikanmofo 04-26-2002 08:09 PM

is there a poll addon i can put on my main page for this hack please? and also will i be able to set a certain image for each post i make? kind of on like those nuke portals you can assign images to like certain topics? can i do it with vbhome?, i would like to add like whose currently online, top 10 posters, member of the day, welcome panel, statistics panel and a login panel to my vbhome, how can i do this, i am having very much problems and confused, my english isn't very good... :( please help

TECK 04-27-2002 12:06 AM

woolF[RM] managed to do it.. the poll. let's see if he can share with anyone else.. ;)
you could pm him to post a reply here on this thread.

wooolF[RM] 04-27-2002 02:53 AM

]the poll? I got it from vb index or whatever it's called with permission of the author (element). it's very easy to implement it into vbHome :)

btw, specially for nakkid :) (see attached)

TECK 04-27-2002 03:00 AM

nice results. thanks woolf. ;)
can you post a tutorial on how to add the poll to vbHome? is pulled from the forums.

wooolF[RM] 04-27-2002 03:05 AM

here's how it looks like when it'a a new poll that u have not voted for...

TECK 04-27-2002 03:08 AM

stop showing off and make those people happy... :)

wooolF[RM] 04-27-2002 03:33 AM

]
Quote:

Originally posted by nakkid
nice results. thanks woolf. ;)
can you post a tutorial on how to add the poll to vbHome? is pulled from the forums.

sure...

1) make a new template called home_poll
PHP Code:

<form action="$bburl/poll.php" method="get">
    <
input type="hidden" name="s" value="$session[sessionhash]">
    <
input type="hidden" name="action" value="pollvote">
    <
input type="hidden" name="pollid" value="$pollinfo[pollid]">
    <
table cellpadding="0" cellspacing="0" border="0"  width="95%" align="center"><tr><td>
    <
table cellpadding="4" cellspacing="1" border="0"  width="100%">
    <
tr>
    <
td bgcolor="#13486D" align="center" colspan="4"><smallfont><b>$pollinfo[question]</b></smallfont></td>
    </
tr>
    
$pollbits
    
</table>
    </
td></tr></table>
    <
table cellpadding="2" cellspacing="0" border="0" width="100%"  align="center">
    <
tr>
    <
td style="font-size: 8pt" align=center><smallfont><br><input type="submit" class="bginput" value="Vote!" style="font-size: 8pt"><br><br>
    <
a href="$bburl/poll.php?s=$session[sessionhash]&action=showresults&pollid=$pollinfo[pollid]">Result</a>
    </
smallfont></td></tr>
    </
table>
    </
form

2) make a new template called home_pollresult
PHP Code:

<table cellpadding="0" cellspacing="0" border="0"  align="center"><tr><td>
    <
table cellpadding="4" cellspacing="1" border="0"  width="100%">
    <
tr>
    <
td colspan="3" bgcolor="#13486D" align="center"><smallfont><b>
    
$pollinfo[question]</b></smallfont><br>
    <
smallfont>$pollstatus</smallfont></td>
    </
tr>
    
$pollbits
    
<tr>
    <
td bgcolor="#0A293E" align="right" ><smallfont color ="#EEEEFF"><b>Votes:</b></smallfont></td>
    <
td bgcolor="#0A293E" align="center"><smallfont color ="#EEEEFF" ><b>$pollinfo[numbervotes]</b></smallfont></td>
    <
td bgcolor="#0A293E" align="center"><smallfont color ="#EEEEFF"><b>100%</b></smallfont></td>
    </
tr>
    <
tr><td colspan=3 bgcolor="#13486D" align=center><smallfont><a href="$bburl/showthread.php?s=$session[sessionhash]&threadid=$pollinfo[threadid]">Comments <b>$pollreplies</b></a></smallfont><br>
    <
a href="$bburl/forumdisplay.php?s=$session[sessionhash]&forumid=$pollsforum"><smallfont>More Polls</smallfont></a></td></tr></table></td></tr>
    </
table

2) edit your vbhome's index.php

2a. right under
PHP Code:

// news forum
$newsforum="47"

add
PHP Code:

// polls forum
$pollsforum="48"

psssttt... remember to change forum ids! ;)

2b. right in the end of the file before
PHP Code:

eval("dooutput(\"".gettemplate('home')."\");"); 

add this:
PHP Code:

// poll
// -------------------------
$pollinfo=$DB_site->query_first("SELECT *,thread.open FROM poll LEFT JOIN thread ON (thread.pollid = poll.pollid) WHERE thread.forumid='$pollsforum' ORDER BY poll.dateline DESC LIMIT 1");

if (!empty(
$pollinfo[question])){
  
$pollinfo[question]=bbcodeparse($pollinfo[question],$pollsforum,1);

  
$splitoptions=explode("|||"$pollinfo[options]);
  
$splitvotes=explode("|||",$pollinfo[votes]);

  
$pollisclosed=0;
  
$pollisactive=$pollinfo[poll.active];
  
$pollid=$pollinfo[poll.pollid];

  
$pollreplycount=$pollinfo[replycount];
  if (
$pollreplycount == "0") {
  
$pollreplies "";
  }
  elseif (
$pollreplycount == "1") {
  
$pollreplies " (1)";
  }
  else {
  
$pollreplies " ($pollreplycount)";
  }
 if (!
$pollinfo[active] or !$pollinfo[open] or ($pollinfo[dateline]+($pollinfo[timeout]*86400)<time() and $pollinfo[timeout]!=0)){
    
//thread/poll is closed, ie show results no matter what
    
$pollisclosed=1;
    } else {
    
//get userid, check if user already voted
    
if ($uservote=$DB_site->query_first("SELECT pollvoteid FROM pollvote WHERE userid='$bbuserinfo[userid]' AND pollid=$pollinfo[pollid]")) {
      
$uservoted=1;
    }
  }
  
$counter=0;
  while (
$counter++<$pollinfo[numberoptions]) {
    
$pollinfo[numbervotes]+=$splitvotes[$counter-1];
  }
  
$counter=0;
  
$pollbits="";
while (
$counter++<$pollinfo[numberoptions]) {
    
$option[question] = bbcodeparse($splitoptions[$counter-1],$pollsforum,1);
    
$option[votes] = $splitvotes[$counter-1];  //get the vote count for the option
    
$option[number] = $counter;  //number of the option

   // Now we check if the user has voted or not

  
if ($pollisclosed or $uservoted) { // user did vote or poll is closed
      
if ($option[votes] == 0){
          
$option[percent]=0;
      } else{
          
$option[percent] = number_format($option[votes]/$pollinfo[numbervotes]*100,2);
      }
      
$option[graphicnumber]=$option[number]%1;
      
// $option[barnumber] = round($option[percent])*2;
      
$option[barnumber] = round($option[percent]);
      
$option[percent] = round($option[percent]);
      if (
$pollisclosed) {
          
$pollstatus "Poll closed.";
      } elseif (
$uservoted) {
          
$pollstatus "You have already voted.";
      }

      
$pollbits .= "<tr><td bgcolor=\"#1C5780\" align=\"left\"><smallfont>$option[question]</smallfont></td>    <td bgcolor=\"#1C5780\" width=\"20\" align=\"left\"><smallfont>$option[votes]</smallfont></td><td bgcolor=\"#1C5780\" align=\"left\" width=\"30\"><smallfont>$option[percent]%</smallfont></td></tr>";
  } else {
     
//  $pollbits .= "<tr><td bgcolor=\"#1C5780\" width=\"5%\"><input type=\"radio\" name=\"optionnumber\" value=\"$option[number]\"></td><td bgcolor=\"#1C5780\" colspan=\"3\"><smallfont>$option[question]</smallfont></td></tr>";

    
if ($pollinfo['multiple']) {
       
$pollbits .= "<tr><td bgcolor=\"#1C5780\" width=\"5%\" onMouseOver=\"this.style.backgroundColor='#13486D'; this.style.cursor='hand';\" onMouseOut=\"this.style.backgroundColor='#1C5780';\"><input type=\"checkbox\" name=\"optionnumber[$option[number]]\" value=\"yes\"></td><td bgcolor=\"#1C5780\" colspan=\"3\"><smallfont>$option[question]</smallfont></td></tr>";
    }else{
       
$pollbits .= "<tr><td bgcolor=\"#1C5780\" width=\"5%\" onMouseOver=\"this.style.backgroundColor='#13486D'; this.style.cursor='hand';\" onMouseOut=\"this.style.backgroundColor='#1C5780';\"><input type=\"radio\" name=\"optionnumber\" value=\"$option[number]\"></td><td bgcolor=\"#1C5780\" colspan=\"3\"><smallfont>$option[question]</smallfont></td></tr>";
    }

  }
}
  if (
$pollisclosed or $uservoted) {
    eval(
"\$poll = \"".gettemplate('home_pollresult')."\";");

  } else {
    eval(
"\$poll = \"".gettemplate('home_poll')."\";");
  }
} else {
  
$poll="No poll available.";
}
//poll finished/////////////////////////////////////////////////////////////////////////// 

4) edit your home template. Add there $poll everywhere u wish
5) Make a new poll in your vbhome poll forum (by the way, be sure to edit group permissions for it, so only admins or trusted group can make new polls)
6) Enjoy :bunny: :D

PS:


All times are GMT. The time now is 03:46 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02281 seconds
  • Memory Usage 1,839KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (4)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete