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)
-   -   vBindex (https://vborg.vbsupport.ru/showthread.php?t=37021)

indiamike 04-19-2002 08:54 AM

Quote:

Originally posted by NTLDR
What is on, or around line 371 in newindex.php? And did you copy the code from an unhacked origional vBulletin index.php that is the same version as you use on your board?
Hmmm...I will check this over the weekend. Since I used a version that is on my forum, but the index is slightly hacked up. I will check there first and compare an old and new version and see if there is anything different.

Mike

indiamike 04-19-2002 09:00 AM

Quote:

Originally posted by hkim
This is probably totally newbie kind of question, but:

After installing vBindex 1.3 as instructed, I find myself with the fact that news and polls are not showing. I have created a forum calles newsforum and a forum called pollforum with normal permissions. Although the threads are viewing all right, I cannot view news or polls.

Any help will be appreciated.

Best regards,


Though I haven't sucessfully installed this hack yet, I would probably check the index.php that you uploaded from this hack. Did you change the variables in the first few lines to match up with the forum id numbers?

Quote:

// news forum
$newsforum=3;

// polls forum
$pollsforum=4;
These two numbers are generic numbers and should be changed to the value of that forum id.
I would check that first.

Mike

hkim 04-19-2002 09:31 AM

Aha...Thanks, Mike! I think that should do the trick!

Best regards,
H.Kim

indiamike 04-19-2002 10:03 AM

Quote:

Originally posted by NTLDR
What is on, or around line 371 in newindex.php? And did you copy the code from an unhacked origional vBulletin index.php that is the same version as you use on your board?

Aha....I figured it out finally. My cookies were messing with it because I used differant styles and didn't add all the new templates to the style that I was using. I just added them to the default template, not the templates for the style that I had chosen to view my board in.

Okay.....works now....time to hack it up and add my own stuff.

Mike

hkim 04-19-2002 11:56 AM

Dear NTLDR/Lee,

Thanks for the info. With risk of sounding somewhat lame, could you please give me some more specific information on how to implement this? E.g.

1. Do I have to rename the index.php to vbindex.php?
2. The new pages, do I create them within the vbulletin control panel?
3. How can a new template page look like? What do I have to include? Specific example would be great.

Best regards,


Quote:

Originally posted by NTLDR


This is why I've chosen not to use a portal system, because it looks the same as everyone elses site and is mean't for a lot of things I don't need or want to do, this way I can fully integrate with my forums and have a common design thoughout my site.

Here is the code you need to find and change for a muli-paged vBindex:

In the vbindex php file change (its right at the end):

PHP Code:

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

To:
PHP Code:

if (!$page)
// no page specified
{
eval(
"dooutput(\"".gettemplate('home')."\");");
}
else
eval(
"dooutput(\"".gettemplate("$page")."\");");
//eval("dooutput(\"".gettemplate('home')."\");"); 

to get the homepage use http://mysiteurl/forumsdir/vbindex.php to get any other page use http://mysiteurl/forumsdir/vbindex.p...=template_name

Where:

vbindex.php is what you have called the index.php file included with vBindex

and

template_name is the name of the template that contains the page.

Let me know if you have any problems,

Regards,
Lee (NTLDR)


hkim 04-19-2002 12:09 PM

Well, it was a stupid request when you gave so clear information at the first place. I found it out by myself after a few minutes.

Thanks anyway! :p

NTLDR 04-19-2002 01:44 PM

Quote:

Originally posted by hkim
Well, it was a stupid request when you gave so clear information at the first place. I found it out by myself after a few minutes.

Thanks anyway! :p

lol!

No problem hkim, if you run into problems let me know, I wouldn't say your question was lame, everyone has different abilities here and I'm quite happy to help anyone who has any problems with anything I've produced.

I hope everything works fine when you impliment the changes.

Juanito 04-19-2002 02:56 PM

Nice work here, this is what I was looking for and it work really great! I'Ve first setup vbhome light but this one fits my needs a lot more as I'm not a programmer and vbhome is almost impossible for me to custumize the way I want.

Got 2 more things I need to ask:

1- Is there a way to use the usergroups permissions of the forum for the threads display?

2- Is is complicated to add a block with the latest 5 thread titles of a specific forum ? (with links to the thread)

Hope those 2 requests will not be too complicated to do...

Thanks a lot!

el3m3nt 04-19-2002 05:25 PM

1- you mean the threads display of the latest threads? in v1.3 of vbindex you can only see these threads on the index-site which you have permission to see.


2- nope, no problem :). add anywhere in the index-file (but before the output of the home-template)!

PHP Code:

$forumid='forumid of the specific forum';
$limit=5;
$query $DB_site->query("SELECT threadid,title FROM thread WHERE visible=1 AND forumid='$forumid' order by lastpost desc limit $limit");

while (
$last5array $DB_site->fetch_array($query)) {
  
$threadid=$last5array[threadid];
  
$threadtitle=$last5array[title];

  
$last5.='<a href=\"showthread.php?s=$session[sessionhash]&threadid=$threadid\">$threadtitle</a><br>';


now just add the variable $last5 anywhere in the right or left-template.

Juanito 04-19-2002 05:52 PM

Thanks a lot, I think something must be messed up then because threads of private forums are seen by everyone in the latest threads column. Not the threads themselves but the titles and it can reveal some sensitive content so...

Where should I look to try finxing this out?

BTW thanks a lot for your fast response, very kind from you ;)

For the code above, I've tried it without success. I forget something maybe?

Code:

$forumid=6;
$limit=5;
$query = $DB_site->query("SELECT threadid,title FROM thread WHERE visible=1 AND forumid='$forumid' order by lastpost desc limit $limit");

while ($last5array = $DB_site->fetch_array($query)) {
  $threadid=$last5array[threadid];
  $threadtitle=$last5array[title];

  $last5.='<a href=\"showthread.php?s=$session[sessionhash]&threadid=$threadid\">$threadtitle</a><br>';
}

I put this in my index file right bellow the variables settings then I've put $last5. I have the link displayed as it it in the code, showing me this: $threadtitle with the code in the link! ("showthread.php?s=$session[sessionhash]&threadid=$threadid\")

Grrr, I'm not a coder sorry! lol

Juanito 04-19-2002 09:58 PM

One more thing, maybe I'll look a bit newbie wit all those questions but as I say I'm not a programmer! I don't find how to enable the right block, any tips for this?

Thanks! ;)

NTLDR 04-20-2002 07:39 PM

In the template home look for a line similar to:

Code:

<!-- $right -->
And chnage it to this:

Code:

$right
You should then be able to see the right block.

Don't worry about feeling like a newbie if you do, we all had (have) to start somewhere :D

Juanito 04-20-2002 08:39 PM

Good, thanks a lot ;)

hkim 04-21-2002 12:14 PM

Some more newbie question:

1. In the lef/right block, there is a link to "My Notepad". What is this? In my default installation of vBulletin 2.2.5 it seems not to be existing?

Best regards,


Quote:

Originally posted by el3m3nt

2 new actions (getdaily and getsticky!) and threads-table-title depends on the action!

(cut)

if ($action == "getsticky") {
// sticky threads
$threadsquery = $DB_site->query("select threadid,forumid,title,postusername,lastposter,rep lycount,iconid from thread WHERE visible=1 AND sticky=1 ".$threadsql." order by lastpost desc limit $numthreads");
$threadstitle="Sticky Threads";
}[/php]

now modify the template "home_threads":
- 2 new options (select)
- replace "Latest Threads" (title) with $threadstitle

that's it. all these improvements will be included in version 1.4.
pls write me all suggestions and ideas how we all can improve this script :). [/B]

Juanito 04-21-2002 12:18 PM

You can get it here, this is a hack called vbpad, this allow your users to keep some personal notes in their CP.

hkim 04-21-2002 03:43 PM

Another one: after installing vBindex, when selecting Forum home in the Forum Jump, I'm redirected to the first page. However, I would like this selection to redirect to a list of available forums instead. How do I do this?

NTLDR 04-21-2002 05:00 PM

Quote:

Originally posted by hkim
Another one: after installing vBindex, when selecting Forum home in the Forum Jump, I'm redirected to the first page. However, I would like this selection to redirect to a list of available forums instead. How do I do this?
What did you call the PHP file in the zip (the vb index php file)? If you called that index.php and renamed your forums index.php to say forums.php for example then thats why you are taken to vbindex and not tghe forum home page.

If this is then if you wish to leave the file names like this then I belive you either have to modify functions.php or set the $bburl in the options to point to url/forums.php where forums.php is the forums home page.

I could be wrong as I haven't tried it!

hkim 04-21-2002 05:16 PM

From what I can see, your site is working in a manner that I would like, e.g. when choosing "forum home" from the Forum jump menu, the user is redirected to the forum list page. Did you do some additional tweaking?

What I did when I installed the vBindex, was that I renamed the original index.php to home.php. After copying the necessary code from the original index.php to vBindex index.php, I then upload it to the vB folder on my site. I have also added your modification for multiple vBindex pages. What should I do?

Best regards,

hkim 04-21-2002 05:54 PM

I think I got it....I should problably change the variable in forumdisplay.php?

// jump from forumjump
$goto = '';
switch($forumid) {
case 'home': $goto = 'index'; break;

to

// jump from forumjump
$goto = '';
switch($forumid) {
case 'home': $goto = 'home'; break;

-=dm=- 04-21-2002 06:27 PM

Hi el3m3nt
Im back :D
I have litle problem with the vBindex:(
its the left block, I dont understand
? New posts [ 22 ] this should be 17
? Posts today [ 17 this should be 22
this is strange I didnt change the original code.
can you please help me?

NTLDR 04-21-2002 07:43 PM

Quote:

Originally posted by hkim
I think I got it....I should problably change the variable in forumdisplay.php?

// jump from forumjump
$goto = '';
switch($forumid) {
case 'home': $goto = 'index'; break;

to

// jump from forumjump
$goto = '';
switch($forumid) {
case 'home': $goto = 'home'; break;

I don't think that will work, I think you need to change where index points to, what file was this in?

hkim 04-21-2002 08:02 PM

Well it seems to work after I made the change. For me it seems to be logical to point the jump string to home, since the forum listing declared by vbulletin index is name home.php now...but here is how my files are organized:

vbulletin index.php --> vbulletin/home.php
vbindex index.php --> vbulletin/index.php

If you got time, I got another question as well:

How do I use the home-templates in for example the default template for forum display? Do I have to define $templatesused in the beginning of forumdisplay.php?

NTLDR 04-21-2002 11:05 PM

It was just a guess based on the snipit of text :D

To use say home_left in the forum listing you would need to make sure that the templates were defined. I'm not 100% sure what screen you wanted it on, if u wanted it on the forums home (the origional index.php) and in the Forum display (forumdisplay.php) then you need to define it in global.php

Which specific screen(s) did u want it on? Either a screenshot or the name of the .php file that appears in the browser would be best :D

Juanito 04-22-2002 03:10 AM

Quote:

Originally posted by el3m3nt
1- you mean the threads display of the latest threads? in v1.3 of vbindex you can only see these threads on the index-site which you have permission to see.


2- nope, no problem :). add anywhere in the index-file (but before the output of the home-template)!

PHP Code:

$forumid='forumid of the specific forum';
$limit=5;
$query $DB_site->query("SELECT threadid,title FROM thread WHERE visible=1 AND forumid='$forumid' order by lastpost desc limit $limit");

while (
$last5array $DB_site->fetch_array($query)) {
  
$threadid=$last5array[threadid];
  
$threadtitle=$last5array[title];

  
$last5.='<a href=\"showthread.php?s=$session[sessionhash]&threadid=$threadid\">$threadtitle</a><br>';


now just add the variable $last5 anywhere in the right or left-template.

I applyed this code as mentioned to me by el3m3nt to help me displaying the last 5 threads of a specific forum and I got this result, it seems the info is not processed or something:

$threadtitle
$threadtitle
$threadtitle
$threadtitle
$threadtitle

Is there something I do wrong or soething is missing? Any idea anyone?

Thanks!

wintz 04-22-2002 05:32 PM

Quote:

Originally posted by -=dm=-
Hi el3m3nt
Im back :D
I have litle problem with the vBindex:(
its the left block, I dont understand
? New posts [ 22 ] this should be 17
? Posts today [ 17 this should be 22
this is strange I didnt change the original code.
can you please help me?

Yeah i`m having the same problem with the New posts and Posts today counts, anyone know how to fix this? thanks

el3m3nt 04-23-2002 10:00 AM

jap i noticed that :).

the following counts the posts (of the new posts and the posts in the last 24 hours)
Code:

$getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE dateline>'$bbuserinfo[lastvisit]'");
$getdailypost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE dateline>=".(time() - (24 * 60 *60 * $days)));

you can also count the new threads if you want..
Code:

$getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM thread WHERE dateline>'$bbuserinfo[lastvisit]'");
$getdailypost=$DB_site->query_first("SELECT count(*) AS posts FROM thread WHERE dateline>=".(time() - (24 * 60 *60 * $days)));

or another possibility.. count the threads ordered by last post
Code:

$getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM thread WHERE lastpost>'$bbuserinfo[lastvisit]'");
$getdailypost=$DB_site->query_first("SELECT count(*) AS posts FROM thread WHERE lastpost>=".(time() - (24 * 60 *60 * $days)));

Note: i didnt tested all queries.. pls ask if you get any errors :).

Esorcista 04-25-2002 09:22 AM

Where should i go to translate this menu?
I didn't find any template..
Tnx

el3m3nt 04-25-2002 10:47 AM

template 'home_logout'

Juanito 04-25-2002 04:45 PM

Still searching to solve this problem, any help please? :confused:

Quote:

Quote:

Originally posted by el3m3nt
1- you mean the threads display of the latest threads? in v1.3 of vbindex you can only see these threads on the index-site which you have permission to see.


2- nope, no problem :). add anywhere in the index-file (but before the output of the home-template)!

PHP Code:

$forumid='forumid of the specific forum';
$limit=5;
$query $DB_site->query("SELECT threadid,title FROM thread WHERE visible=1 AND forumid='$forumid' order by lastpost desc limit $limit");

while (
$last5array $DB_site->fetch_array($query)) {
  
$threadid=$last5array[threadid];
  
$threadtitle=$last5array[title];

  
$last5.='<a href=\"showthread.php?s=$session[sessionhash]&threadid=$threadid\">$threadtitle</a><br>';


now just add the variable $last5 anywhere in the right or left-template.

I applyed this code as mentioned to me by el3m3nt to help me displaying the last 5 threads of a specific forum and I got this result, it seems the info is not processed or something:

$threadtitle
$threadtitle
$threadtitle
$threadtitle
$threadtitle

Is there something I do wrong or soething is missing? Any idea anyone?

Thanks!

indiamike 04-25-2002 10:35 PM

I haven't read through this whole thread so maybe my problem with this has been solved already.

But here we go. I installed this hack and am testing it out, and the problem that I run into is that it changes my database for the "most users ever online". Every time I mess with the hack it resets mysql table back to the amount that was online today only.

Is there anyway I can go back and revert, or should I just dump the table and insert a new one.

Does this hack change that table in anyway?

Mike

I hope this makes sense.

Juanito 04-25-2002 11:06 PM

Had this issue too, but I don't know how to fix it so I've removed the max users display...

wintz 04-26-2002 08:16 AM

Yeah i have the same thing with the most users every online, i would love to know how to fix/repair this. Thanks

el3m3nt 04-26-2002 03:25 PM

ehm.. i'm not sure.. and i didnt test it..
just delete this part...

Code:

  if ((int)$maxusers[0] <= $totalonline) {
    $time = time();
    $maxloggedin = "$totalonline " . $time . " " . $maxusers[2] . " " . $maxusers[3];
    $DB_site->query("UPDATE template SET template='$maxloggedin' WHERE title='maxloggedin'");
    $maxusers[0] = $totalonline;
    $maxusers[1] = $time;
  }


wintz 04-26-2002 06:18 PM

ok thanks, i`ll give it a shot ;)

indiamike 04-26-2002 08:39 PM

Hmmm...something is awry...the fix didn't work for me.

This is what happens, I have the php file loaded up for test purposes until I figure all of it out. It is named newindex.php just for ease of use (I haven't really messed with it since installing it). If I go to my forum the number "Most users ever online" works and functions like it should.

If I pull up the newindex.php it resets the "most users ever online" back to one (or however many are online at that time). I don't click anything it just changes on the load.

I followed the instructions you left above but it didn't seem to cure it.

Any other suggestions?

Mike

NTLDR 04-26-2002 08:51 PM

Well I've modded my file to see how it goes, I'll yet everyone know if it works, this is one thing that has really bugged me since installing vBindex :D

NTLDR 04-27-2002 05:49 AM

Quote:

Originally posted by el3m3nt
Code:

  if ((int)$maxusers[0] <= $totalonline) {
    $time = time();
    $maxloggedin = "$totalonline " . $time . " " . $maxusers[2] . " " . $maxusers[3];
    $DB_site->query("UPDATE template SET template='$maxloggedin' WHERE title='maxloggedin'");
    $maxusers[0] = $totalonline;
    $maxusers[1] = $time;
  }


Well I have removed this code and it hasn't worked for me either, has this fixed the problem for anyone else?

wintz 04-27-2002 07:15 AM

I also removed the code but it didn`t work for me either

-=dm=- 04-27-2002 09:55 AM

Quote:

Originally posted by Juanito
Had this issue too, but I don't know how to fix it so I've removed the max users display...
Me and NTLDR did the same, we removed it too :D

NTLDR 04-27-2002 06:24 PM

OK, I have removed the folloing code from the file and at the moment it seems to be working correctly.

Either remove (or comment out each line with // ):
PHP Code:

// today online hack by Mystics - start
  
if ((int)$maxusers[0] <= $totalonline) {
    
$time time();
    
$maxloggedin "$totalonline " $time " " $maxusers[2] . " " $maxusers[3];
    
$DB_site->query("UPDATE template SET template='$maxloggedin' WHERE title='maxloggedin'");
    
$maxusers[0] = $totalonline;
    
$maxusers[1] = $time;
  }

  
$todayloggedinusers "";
  
$numbertodayonline 0;
  
$numbertodayonlineinvisible 0;

  
$todayusers=$DB_site->query("SELECT userid, username, usergroupid, lastactivity, invisible FROM user
                WHERE lastactivity > " 
mktime(0,0,0,date("m"),date("d"),date("Y")) . "
                ORDER BY username"
);
  while (
$todayuser=$DB_site->fetch_array($todayusers)) {
    
$numbertodayonline++;
    if (
$todayuser['invisible']==and $bbuserinfo['usergroupid']!=6) {
      
$numbertodayonlineinvisible++;
      continue;
    }
  }

  
$DB_site->free_result($todayusers);

  if (
$bbuserinfo[usergroupid] == 6) {
    
$todayonline $numbertodayonline;
  } else {
    
$todayonline $numbertodayonline $numbertodayonlineinvisible;
  }
//today online hack by Mystics - end 

The downside to this is that you can't display the number of registered users logged in today on the vBindex page, so you also need to remove (or comment out):

Code:

<a href="online.php?s=$session[sessionhash]">Online Today</a>: <b>$todayonline</b><br>
From the template home_left

Let me know if this works for you, it seems to for me at the moment :D


All times are GMT. The time now is 11:52 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.01716 seconds
  • Memory Usage 1,893KB
  • 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
  • (9)bbcode_code_printable
  • (6)bbcode_php_printable
  • (15)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (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