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)
-   -   mYvBindex v3.1 (https://vborg.vbsupport.ru/showthread.php?t=44691)

350Chevy 12-04-2002 03:08 AM

Results of the second one were fast as well..

Query: SELECT thread.pollid,thread.open FROM thread WHERE thread.forumid='108' ORDER BY thread.dateline DESC LIMIT 1
Time before: 0.20433604717255
Time after: 0.20571005344391

alkatraz 12-04-2002 03:16 AM

Hate to interrupt your guys troubleshooting session here but I'm curious if there's a way to add more custom templates? =)

I'm using a portal page write now that I did in html, and I have 5 sections that I would need to add.

Thanks!

Tigga 12-04-2002 03:20 AM

Ok, since both of those seem ok I guess it's not a problem with it querying the table, so maybe it's something with the way they are joined.

Try this query and see if it's any better...
PHP Code:

$pollinfo=$DB_site->query_first("SELECT poll.pollid,poll.question,poll.dateline,poll.options,poll.votes,poll.active,poll.numberoptions,poll.timeout,poll.multiple,poll.voters,thread.pollid,thread.open FROM poll LEFT JOIN thread USING (pollid) WHERE thread.forumid=$pollsforum ORDER BY poll.dateline DESC LIMIT 1");{ 


350Chevy 12-04-2002 03:20 AM

alkatraz,

I would imagine you would just change this

Code:

// Custom Boxes
$custom1='';
$custom2='';
if ($showcustom1) {
  $getbgrow=getrowcolor();
  eval("\$custom1 .= \"".gettemplate('index_custom1')."\";");
}
if ($showcustom2) {
  $getbgrow=getrowcolor();
  eval("\$custom2 .= \"".gettemplate('index_custom2')."\";");
}

to something like this...

Code:

// Custom Boxes
$custom1='';
$custom2='';
$custom3='';
$custom4='';
$custom5='';
if ($showcustom1) {
  $getbgrow=getrowcolor();
  eval("\$custom1 .= \"".gettemplate('index_custom1')."\";");
}
if ($showcustom2) {
  $getbgrow=getrowcolor();
  eval("\$custom2 .= \"".gettemplate('index_custom2')."\";");
}
if ($showcustom3) {
  $getbgrow=getrowcolor();
  eval("\$custom3 .= \"".gettemplate('index_custom3')."\";");
}
if ($showcustom4) {
  $getbgrow=getrowcolor();
  eval("\$custom4 .= \"".gettemplate('index_custom4')."\";");
}
if ($showcustom5) {
  $getbgrow=getrowcolor();
  eval("\$custom5 .= \"".gettemplate('index_custom5')."\";");
}

And create templates for each.

Then edit the 'index' template located under mYvBindex Templates and add $custom3, $custom4, $custom5 where ever you want the templates to be displayed.

350Chevy 12-04-2002 03:22 AM

Quote:

Originally posted by PlurPlanet
Ok, since both of those seem ok I guess it's not a problem with it querying the table, so maybe it's something with the way they are joined.

A little better...

Page generated in 2.58082700 instead of 3.6 - 4 seconds. :)

Tigga 12-04-2002 03:29 AM

To add more custom templates to your homepage, follow the instructions below...

Look in your myvbindex.php file look inbetween the following lines of code:
PHP Code:

if ($showcustom2) {
  
$getbgrow=getrowcolor();
  eval(
"\$custom2 = \"".gettemplate('index_custom2')."\";");


And:
PHP Code:

$getbgrow=getrowcolor();
eval(
"dooutput(\"".gettemplate('index')."\");");

?> 

In that space you can add code for it to call more custom templates. You would just add something like the following:

PHP Code:

eval("\$custom3 = \"".gettemplate('index_custom3')."\";"); 

Or, if you would prefer to have the option to turn these templates on/off in the Admin CP like the first two, you would add something like this:
PHP Code:

if ($showcustom3) {
  
$getbgrow=getrowcolor();
  eval(
"\$custom3 = \"".gettemplate('index_custom3')."\";");


Then, only if you want to add the options to turn them on/off you would run the following queries via phpMyAdmin.

INSERT INTO setting VALUES (NULL,50,'Show Custom Template 2?','showcustom2','0','Show your second customized template.','yesno','30');

You would change the two places you see the number 2 in that query to 3, then 4, and so on for more templates. You would also need to change the last number (30) to incriment by one for each template you add (that's the part that tells it what order the option should be displayed).


The variable $custom3 in the code above can be called whatever you would like and would be what you would place in your index template to display your new custom template. Then the part index_custom3 in the above code may be renamed to whatever you would like to call your new template. Also, if you would like to be able to use the $getbgrow variable in that template to alternate between your firstaltcolor & secondaltcolor, you should add the following above that code as it is with the others.

$getbgrow=getrowcolor();

Tigga 12-04-2002 03:39 AM

Ok... I don't see where either of these queries would make a difference, but then again I don't see why it would be taking that one so long, so it's worth a shot, right? :)

Try this one:
PHP Code:

  $pollinfo=$DB_site->query_first("SELECT thread.pollid, thread.open, poll.pollid, poll.question, poll.dateline, poll.options, poll.votes, poll.active, poll.numberoptions, poll.timeout, poll.multiple, poll.voters FROM thread LEFT JOIN poll USING (pollid) WHERE thread.forumid=$pollsforum ORDER BY thread.pollid DESC LIMIT 1");{ 

And if that doesn't help maybe this one:
PHP Code:

  $pollinfo=$DB_site->query_first("SELECT thread.pollid, thread.open, poll.pollid, poll.question, poll.dateline, poll.options, poll.votes, poll.active, poll.numberoptions, poll.timeout, poll.multiple, poll.voters FROM thread LEFT JOIN poll ON (thread.pollid=poll.pollid) WHERE thread.forumid=$pollsforum ORDER BY thread.pollid DESC LIMIT 1");{ 


350Chevy 12-04-2002 03:41 AM

First one did it...

Page generated in 0.54202199 seconds

There's no link for discuss this poll but everything else works like a charm. :)

Tigga 12-04-2002 03:47 AM

Alright! All I did was basically have it call to the thread table rather than the poll table first. Don't see why that made a difference, but hey it works now. ;)

To fix the discuss this poll link just change the first part of the query to "SELECT thread.pollid, thread.open, thread.threadid," adding the thread.thredid in there. It figures I'd forget one small part when changing it. :)

350Chevy 12-04-2002 03:50 AM

LOL

Thanks a million.. :)


All times are GMT. The time now is 09:02 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.02374 seconds
  • Memory Usage 1,764KB
  • 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
  • (2)bbcode_code_printable
  • (7)bbcode_php_printable
  • (1)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