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)

corsacrazy 12-02-2002 02:51 PM

Quote:

Originally posted by PlurPlanet
Hmm, that's odd... I noticed in your profile that you have 40 hacks installed, so it is possible that something else could be affecting it. If you would like to email me (brian@plurplanet.com) with your newreply.php and newthread.php files I'll be glad to take a look and see if I can figure it out.
Also, what do you have set for News Forum ID and News Posts Maximum in the admin options? Could you post the url to your myvbindex.php file on the server so I can take a look there too?

no problem mate i appriciate it, i will do as u requested asap !


here is what i hav in my options

News Forum ID : 15

News Posts Maximum : 1

News Maximum Characters : 5000

Tigga 12-02-2002 03:44 PM

Ok, your settings are fine so I would guess it's something with another hack. Were you able to post a new news topic after you installed the hack? If so, could you check with phpMyAdmin to see if the news column has an "N" or a "Y" in it for that column? Whenever you email me your files I'll test them on one of my servers and hopefully find out what's causing the conflict.
Also, if you already had a news forum before you installed the hack those posts will not show up, only new ones. If you did already have that section I can give you a query to run that will update those posts once everything's working right.

Tony DiMera 12-02-2002 09:47 PM

Actually I upgraded my phpmyadmin to 2.3.3 RC and I wasable to run the queries. So that was my prob I have to lold of a version.

350Chevy 12-03-2002 02:24 AM

installed.. although the Top xx Posters add-on would be nice. And it takes about 4 times longer to load than my last index.. And I'm on Cable! :D

350Chevy 12-03-2002 02:32 AM

Hmm, also the weather add-on is not working correctly.. it shows the city, the images, humitidy and everything except the weather...??

http://www.ls6.com

Tigga 12-03-2002 02:32 AM

I think there's a hack for the top xx posters here that could probably be integrated with this. If not let me know and I can probably make a quick one for you.
The page shouldn't take more than about 1/2 second to load though (usually closer to 1/10 of a second). Do you have the weather part of the hack turned on? If so then that would be the cause. I actually had to take that off my personal website because it was causing my homepage to take 10-20 seconds to load!

Tigga 12-03-2002 02:36 AM

Quote:

Originally posted by 350Chevy
Hmm, also the weather add-on is not working correctly.. it shows the city, the images, humitidy and everything except the weather...??

http://www.ls6.com

Do you mean the temperature? That's something that I never could figure out... It works just fine on most servers, but for some reason it won't show the temperature on others. That part isn't my hack, but I've looked at the coding and everything looks good, so my only guess would be it's something to do with the way certain servers are configured.

350Chevy 12-03-2002 02:44 AM

Quote:

Originally posted by PlurPlanet
I think there's a hack for the top xx posters here that could probably be integrated with this. If not let me know and I can probably make a quick one for you.
The page shouldn't take more than about 1/2 second to load though (usually closer to 1/10 of a second). Do you have the weather part of the hack turned on? If so then that would be the cause. I actually had to take that off my personal website because it was causing my homepage to take 10-20 seconds to load!

10-20 seconds! Ouch!

Yup, Taking that out helped a little. :)

I think I'll put it back in and play around with it some more. Looks great though! :)

350Chevy 12-03-2002 02:44 AM

Quote:

Originally posted by PlurPlanet

Do you mean the temperature? That's something that I never could figure out... It works just fine on most servers, but for some reason it won't show the temperature on others. That part isn't my hack, but I've looked at the coding and everything looks good, so my only guess would be it's something to do with the way certain servers are configured.

Yup, sorry. I'm a bit tired.. hehe.. I'll check the weather mod thread and see what I can dig up. ;)

Thanks a bunch for the super quick replies!

350Chevy 12-03-2002 08:08 PM

Is there a way to get it to show the last person who posted in a thread instead of the thread starter? Or would that create too many queries? Just wondering.

Tigga 12-03-2002 08:51 PM

That's not hard to do at all and won't affect the queries one way or another. Just open up your myvbindex.php file and look for:
PHP Code:

$threads=$DB_site->query("SELECT thread.threadid,thread.title,thread.replycount,thread.postusername 

You would just replace "thread.postusername" at the end of that with "thread.lastposter". Then you would want to edit your index_threadbit template and replace this:

by <a href="$bburl/member.php?s=$session[sessionhash]&action=getinfo&userid=$thread[postuserid]">$thread[postusername]</a>

with this:

by <a href="$bburl/member.php?action=getinfo&find=lastposter&threadid =$thread[threadid]">$thread[lastposter]</a>

350Chevy 12-03-2002 09:34 PM

hmm, my threads string looks completely different in myvbindex.php

Code:

$threads=$DB_site->query("SELECT * FROM thread WHERE open='1' AND open<>10 $iforumperms ORDER BY lastpost DESC LIMIT $maxlatethreads");
while ($thread=$DB_site->fetch_array($threads)) {
  $title = unhtmlspecialchars($thread['title']);
  if (strlen($thread['title']) > $maxthreadchars and $maxthreadchars!=0) {
    $title = substr($thread['title'], 0, $maxthreadchars - 3) . '...';
}
  if ($showthreaddate) {
          $thread['time'] = vbdate($timeformat, $thread['dateline']);
          $thread['date'] = date("m-d-y", $thread['dateline']);
}

The news string looks simular to what you posted but that's for the news.. not the recent threads. ;)

Tigga 12-03-2002 09:43 PM

Ahhh, sorry about that. I changed that query a little when I was working on things and didn't realize it wasn't like that for the version on here. Really though, it makes your job a little easier. Just make the template modification above and it should work fine. :)

350Chevy 12-03-2002 09:48 PM

Gotcha! Thanks again! :)

I'm still trying to figure out why the weather temperatures don't show.

The front page now takes about 6 seconds or longer to load now too. There's not a lot of queries and the server and site are very fast. It's just the main page that takes a while to load. I've noticed other people with slower servers on sites that have low bandwidth and they load much faster than mine. Something doesn't add up...??

Tigga 12-03-2002 09:56 PM

No problem at all. :)
I'm still puzzled as to why the temperature doesn't work on some servers too... It works fine on my personal site, but not on my test server.
Does the page load ok if the weather is turned off? I was having that problem with mine too. It's nothing to do with the queries or anything like that, it's because it's now taking forever for it to get the weather info from theweatherchanel.com's server. That wasn't a problem a few moths ago, but for some reason it's now taking forever to get that info. I'm going to try to find another solution to display the weather when I get the time because I really like that feature, but I can't deal with my homepage taking 10-20 seconds to load.

350Chevy 12-03-2002 10:30 PM

nah.. with it turned off it still takes the same amount of time. The old index page was loading in 0.2 seconds or there abouts. Really fast.. I wonder how it loads on dialup.. lol

Maybe because it's grabbing a bunch of different templates where as my old index was only a few templates that did almost the same as your myvbindex. Yours looks better so I went with yours. ;)

Tigga 12-03-2002 10:43 PM

It really should take less than 1/2 second to load. Do you know how to put vBulletin in debug mode? If not, just open up your admin/config.php file and add $debug="1"; somewhere in there. Then upload that file, go to your index page and add ?explain=1 at the end of the url. That will show a breakdown of each query performed, how long it took, and etc. If you'd like to do that and post the results here I'll be glad to take a look and find out what's causing your page to take so long. Oh, and be sure not to leave it in debug mode afterwards because it could be a security risk. ;)

Oh, and it wouldn't have anything to do with the number of templates it's calling. It would have to be a query somewhere that's taking a while to execute.

350Chevy 12-03-2002 10:51 PM

hmm.. looks to be the poll...

--------------------------------------------------------------------------------

Query: SELECT poll.*,thread.* FROM poll LEFT JOIN thread ON (thread.pollid = poll.pollid) WHERE thread.forumid='108' ORDER BY poll.dateline DESC LIMIT 1
Time before: 0.20745205879211
Time after: 3.5907980203629

table type possible_keys key key_len ref rows Extra
poll ALL 94 Using temporary; Using filesort
thread ALL 5231 where used

--------------------------------------------------------------------------------

350Chevy 12-03-2002 10:54 PM

Yup.. I disabled the poll and check it out now..

Page generated in 0.32854795 seconds (54.16% PHP - 45.84% MySQL) with 25 queries.
[Debug Mode OFF] [PHP v4.2.3] [GZIP enabled - level 1] [Server Load: 1.18 ยป 1.35 : 1.18]

Tigga 12-03-2002 10:57 PM

Quote:

Query: SELECT poll.*,thread.* FROM poll LEFT JOIN thread ON (thread.pollid = poll.pollid) WHERE thread.forumid='108' ORDER BY poll.dateline DESC LIMIT 1
Time before: 0.20745205879211
Time after: 3.5907980203629
Well that would be the problem... Right there it took 3.3 seconds just to load the poll. Now that I know what the cause is I'll look over the files and see if I can figure out why it would be taking that long.

350Chevy 12-03-2002 10:59 PM

No problem.. I had another poll running before that didn't use the vB software and worked fine. If anything I'll just slap that puppy in there in place of the current poll.. ;)

Thanks for the suggestion. I never would have thought of that. And I must say you've helped me greatly. Much more help from you than anyone on any other forum! Many thanks! :D

350Chevy 12-03-2002 11:23 PM

I added your name and a link to your website in the footer on the main page to give you credit for the main page and for all the help. :)

Tigga 12-03-2002 11:35 PM

No problem at all. I never mind helping when I have the time. And thanks for the link. :)

When I checked the time it takes for a poll on my test server that query was done in about 0.002 seconds. The only thing I can think of at the moment is maybe you have another hack installed that's affecting it?
You can try replacing the query:
PHP Code:

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

With this one here:
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 ON (thread.pollid = poll.pollid) WHERE thread.forumid='$pollsforum' ORDER BY poll.dateline DESC LIMIT 1");{ 

The original query tells the script to select all columns from the thread and poll tables. The new one tells it to only select the fields that are really necessary. Normally it selecting a couple of extra fields shouldn't be a problem, but I guess it could be in this case. Anyways, try that and see if it helps any and if not I'll try to figure out something else.

350Chevy 12-03-2002 11:41 PM

nah.. still at 3.6 seconds.. no problem.. I'll add the code in there to show my old poll.. I think it may have something to do when I upgraded from phpBB to vB. My forums and threads are way off as you could tell with the forum ID's being in the 100's. My post ID's are in the 100,000's! :D

Everything runs fine it's just the post and forum ID's are set really really high and I have no idea on how to drop them down. More than likely that's the cause. I'll play around with adding the old poll. For now I need to throw some steaks on the Bar-B. :)

Tigga 12-03-2002 11:56 PM

I was kind of wondering why the forumid #'s were so high. I still don't see why that would affect the way the poll functions, but then again I've never imported phpbb into vb, so I don't know much about the way it does it. Oh well, enjoy your steaks! :)

350Chevy 12-04-2002 01:57 AM

with your new changes...

Query: SELECT poll.pollid,poll.question,poll.dateline,poll.optio ns,poll.votes,poll.active,poll .numberoptions,poll.timeout,poll.multiple,poll.vot ers,thread.pollid,thread.open FROM poll LEFT JOIN thread ON (thread.pollid = poll.pollid) WHERE thread.forumid='108' ORDER BY poll.dateline DESC LIMIT 1
Time before: 0.20889496803284
Time after: 2.7886350154877

table type possible_keys key key_len ref rows Extra
poll ALL 94 Using temporary; Using filesort
thread ALL 5235 where used

--------------------------------------------------------------------------------

table type possible_keys key key_len ref rows Extra
pollvote ref userid userid 8 const,const 1 where used

--------------------------------------------------------------------------------

Query: SELECT * FROM thread WHERE open='1' AND open<>10 AND forumid=85 OR forumid=88 OR forumid=93 OR forumid=96 OR forumid=101 OR forumid=86 OR forumid=87 OR forumid=89 OR forumid=90 OR forumid=91 OR forumid=92 OR forumid=94 OR forumid=95 OR forumid=97 OR forumid=98 OR forumid=99 OR forumid=100 OR forumid=107 OR forumid=102 OR forumid=103 OR forumid=104 OR forumid=105 ORDER BY lastpost DESC LIMIT 10
Time before: 2.8690160512924
Time after: 3.2530399560928

350Chevy 12-04-2002 02:01 AM

hmm.. it's still using all 5000+ threads...??

Tigga 12-04-2002 02:37 AM

I'm not quite sure if I follow you about it using all 5000 threads... The first query looks the way it should, though I'm still not sure why it would be taking so long to execute. The other query there is from the latest threads part of the hack where it is checking each forum.

If you want to try something else, you can try replacing the poll query with this on here:
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 FROM poll ORDER BY poll.dateline DESC LIMIT 1");{ 

See what the time is like with that one and if it isn't improved, then try this one here:
PHP Code:

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

Neither of those will actually fix the problem or let the poll work properly, but the first one leaves out the call to the thread table, and the second one leaves out the call to the poll table. If either of those improves the time then we know which table it's taking so long to query and will at least know a little more about what's causing it. Also, if the first query reduces the time, I may be able to work around calling the thread table.

350Chevy 12-04-2002 03:01 AM

ok.. I'll post the times in a second. :)

350Chevy 12-04-2002 03:07 AM

Results of the first line were quick...

Query: SELECT poll.pollid,poll.question,poll.dateline,poll.optio ns,poll.votes,poll.active,poll .numberoptions,poll.timeout,poll.multiple,poll.vot ers FROM poll ORDER BY poll.dateline DESC LIMIT 1
Time before: 0.20555102825165
Time after: 0.20668196678162

table type possible_keys key key_len ref rows Extra
poll ALL 94 Using filesort

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 02:25 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.01985 seconds
  • Memory Usage 1,877KB
  • 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
  • (3)bbcode_code_printable
  • (12)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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