vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Latest Threads On Forum Home (https://vborg.vbsupport.ru/showthread.php?t=60544)

NTLDR 01-20-2004 10:00 PM

Latest Threads On Forum Home
 
Latest Threads On Forum Home
Version: 1.0.2
vB-version: 3.0.0 Release Candidate 2
Developer: NTLDR
Install-difficulty: 1
File-edits: 2
Template-edits: 1

Description of the Hack:
This is taken from my vBindex hack and will display the latest X threads on your forum home page. Permissions are done automatically so forums users can't view will be excluded. Includes thread icon/goto new post image (if the thread is unread), title, last post info, number of views and replies.



Files modified for this Hack:
index.php


New templates for this Hack:
forumhome_latestthreadbit


Templates modified for this Hack:
FORUMHOME

New phrases for this Hack:
latest_threads

WAR 01-21-2004 01:55 PM

muchas gracias senior!!

/me clicks first to install

ChrisSy 01-21-2004 01:58 PM

great work thanks, now just need a way to get it into my sidebar :)

thanks

KuraFire 01-21-2004 02:34 PM

I take it you're enjoying the HTL ? :)

NTLDR 01-21-2004 02:43 PM

It was alot easier figuring out howto create the HTL install instrctions then trying to make a text file look clear and easy. Once its released I'll provided an updated HTL version :)

KuraFire 01-21-2004 03:26 PM

Quote:

Originally Posted by NTLDR
It was alot easier figuring out howto create the HTL install instrctions then trying to make a text file look clear and easy. Once its released I'll provided an updated HTL version :)

Which will be even easier, still! :)

Don't forget to change the title of the thread (when you go for a HTL installer) to have the [HTL] prefix, to denote that it has a .htl installer file. Makes for much easier checking out for people who want to see which hacks are HTL-hacks :)

(of course, you're free not to do it, but hey, it helps people, and it's not that big a hassle ;))

WAR 01-21-2004 04:05 PM

Where would I change how many recent threads are displayed?

NTLDR 01-21-2004 04:07 PM

Quote:

Add ABOVE that:

Note: Change 5 in this part of the query to change the number of threads to show: DESC LIMIT 5
Change ORDER BY lastpost to ORDER BY dateline to stop it showing threads with new posts.

^^ See that comment above the relevent section of code in the install instructions.

WAR 01-21-2004 04:15 PM

Quote:

Originally Posted by NTLDR
^^ See that comment above the relevent section of code in the install instructions.

[high] * WAR blushes for missing that
[/high]

Your level of support for your hacks is amazing!

Thanks alot

MGM 01-21-2004 10:03 PM

Good job! I could use this one!

/me clicks Install

MGM out

Goyko 01-22-2004 10:15 AM

Hi NTLDR,

I love this hack!

Anyway - Some problems resist:
Collapsing this section collapses it. <- o.k.
BUT - it doesn't remember the status (collapsed/uncollapsed)
To be honest, it's acting very weird ... sometimes the icon doesn't change... sometimes it's the wrong icon... sometimes it stays collapsed... sometimes not.

And if there was no post icon chosen for the post it shows a broken image link in front of every thread listed in the box.

Maybe you give it a try and recheck those issues?
Would be great to use this hack fully functional!
Thanks!

btw: I'm using it with the RC3 version. But I guess that couldn't be it?!

Best regards...
Goyko

NTLDR 01-22-2004 11:44 AM

In your FORUMHOME template find:

HTML Code:

style="$vbcollapse[collapseobj_forumhome_threads]">
Replace with:

HTML Code:

style="$vbcollapse[collapseobj_forumhome_latestthreads]">
That should fix the expand/collapse issue.

Do you have a default icon specified in your options? If so what have you entered there?

Goyko 01-22-2004 05:01 PM

Quote:

Originally Posted by NTLDR
In your FORUMHOME template find:

HTML Code:

style="$vbcollapse[collapseobj_forumhome_threads]">
Replace with:

HTML Code:

style="$vbcollapse[collapseobj_forumhome_latestthreads]">
That should fix the expand/collapse issue.

Works perfectly! Thank you very much!!!

Quote:

Do you have a default icon specified in your options? If so what have you entered there?
Err..... to be honest I can't find this option.
Can you gimme a hint, where to look for it?

Best regards
Goyko

NTLDR 01-22-2004 05:25 PM

ACP -> vBulletin Options -> Thread Display Options (showthread) -> Show Default Post Icon

I assume its still there in post Gamma versions.

Goyko 01-22-2004 05:37 PM

Quote:

Originally Posted by NTLDR
ACP -> vBulletin Options -> Thread Display Options (showthread) -> Show Default Post Icon

I assume its still there in post Gamma versions.

Oh .. I was looking for a radio button :ermm:

Yes I have entered "images/icons/icon1.gif" in this field.
And the icon exists.

But ... shame on me :rolleyes:... the problem is NOT the default icon!
There are only problems, if an icon has been chosen for the post!
So it's the exact opposite, from what I was telling before.
Weird!

Sorry for misleading you ... should have observed more carefully!

Best regards...
Goyko

NTLDR 01-22-2004 06:33 PM

OK, this should fix it:

Find this code in index.php

PHP Code:

    if ($thread['iconid']) {
        
$show['icon'] = true;
        
$thread['threadiconpath'] = &$iconcache["$thread[threadiconid]"]['iconpath'];
        
$thread['threadicontitle'] = &$iconcache["$thread[threadiconid]"]['title'];
    } elseif (!empty(
$vboptions['showdeficon'])) {
        
$show['icon'] = true;
        
$thread['threadiconpath'] = $vboptions['showdeficon'];
        
$thread['threadicontitle'] = $vbphrase['default'];
    } 

Replace it with:

PHP Code:

    $icon fetch_iconinfo($thread['iconid']);
    
    if (
is_array($icon)) {
        
$show['icon'] = true;
        
$thread['threadiconpath'] = $icon['iconpath'];
        
$thread['threadicontitle'] = $icon['title'];
    } 

That should fix it :)

Goyko 01-22-2004 07:14 PM

All it does, is leading to a parse error on line 464 :(

Greez
Goyko

NTLDR 01-22-2004 07:20 PM

Whats on line 464?

Goyko 01-22-2004 07:32 PM

Never mind :rolleyes:

I forgot a closing ";" at the end.

Now going to check if it works.

Goyko

Edit:

Now it works!
Thanks very much!

StarBuG 01-23-2004 08:48 AM

Thank you for making this hack!

You should put your Icon FIX into the installer cause I had the same problem!
After the fix it seems to worked with the icons


HOWEVER why can I see postings made in my developer section when I?m loged out?
Only Admins and Developers have access there!???

I thought the permissions where checked before displaying?

* StarBuG clicks install but hopes the fix for permissions comes soon

StarBuG

NTLDR 01-23-2004 09:07 AM

I can't confirm this, I've just tested this code again and it excludes the forums I don't have access to. Are you sure you setup the permissions correctly? This checks the canview and can view others permissions for each forum.

StarBuG 01-23-2004 09:16 AM

<a href="http://www.hiphop-battles.com/forum/index.php" target="_blank">http://www.hiphop-battles.com/forum/index.php</a>?

Can you please go there and tell me wich 5 threads you see last posted?
I´ve already checked the permissions. Guest have all NO in these category and the subforums are inharited

Greetings

Star

NTLDR 01-23-2004 09:26 AM

There are threads that I don't have access to, I looked before I double checked the code. Do you have any other changes made to index.php? I've been using this code for 7 months now with no problems.

Upload the attached file and run it as a user of various groups, it should print a list of all the forums you don't have access to. Try it as a guest and see if it mentions the forums that appear on the latest threads.

StarBuG 01-23-2004 09:31 AM

No Access To Forum ID: 14 (Mod Cat)
No Access To Forum ID: 15 (Mod)
No Access To Forum ID: 11 (Dev Cat)
No Access To Forum ID: 12 (Dev)
No Access To Forum ID: 13 (Dev)

That are exactly the forums I don´t want guests to have in
But I still can see the posts from these forums!

I made some changes in index (users only last 24 hours) but I don´t think that this is the reason for the problem cause there is nothing related to permissions

Any ideas?

Greetings

Star

Goyko 01-23-2004 11:18 AM

I can confirm the problem, Starbug is talking about!

It includes the forums, I have NO access to, lists the new posts, but if I click on an entry, it tells me, that I don't have access to view it.

Shouldn't be even visible!

Best regards.
Goyko

NTLDR 01-23-2004 12:10 PM

Turn on debug mode, add $debug = 1; in config.php and then visit index.php?showqueries=1 and look for the query smimilar to what you added to index.php, in particular this bit:

[sql]AND forumid NOT IN (0)[/sql]

It should be 0,X,Y,Z where each of the letters represents a forum that your not allowed to view. If its just got 0 then I'll rework the code.

StarBuG 01-23-2004 12:17 PM

I added the line to the config.php but nothing showed up at index.php?showqueries=1

But the debug mode is on cause I have the drop down below my forum and wich templates where called (I deactivated it again)

Do I have to do something in AdminCP as well?

Star

NTLDR 01-23-2004 12:19 PM

Click the 'Explain' link, it does a similar thing.

StarBuG 01-23-2004 12:22 PM

It only shows up an empty page!

I leave it on for you to check

Hope you can help me

You can see the hacks I´ve installed in my news forum (but only the useronline required editing the index.php)

Greetings

Star

NTLDR 01-23-2004 12:23 PM

Change:

PHP Code:

$limitfids ','.$forum['forumid']; 

To:

PHP Code:

$limitfids .= ','.$forum['forumid']; 

I missed a . out.

NTLDR 01-23-2004 12:23 PM

Quote:

Originally Posted by StarBuG
It only shows up an empty page!

Well it works fine for me, I just viewed it on your site :) Regardless the above change will fix the issue :)

StarBuG 01-23-2004 12:25 PM

YES

It works!!!

PERFECT!

Thank you very much for the fast support

StarBuG

Goyko 01-23-2004 12:30 PM

Quote:

Originally Posted by StarBuG
YES
Thank you very much for the fast support

StarBuG

From me too !!!
Now it does work perfectly!

Thanks for this great hack!

Best regards
Goyko

dutchbb 01-24-2004 12:45 PM

how many queries does it add? thanks

mharmon 01-24-2004 04:37 PM

Great Thread! :)

M.C. 01-24-2004 09:17 PM

i`d love to see that panel just under navbar i was trying to put it there but colapse doesn`t work so far... :( any chanse for help?

NTLDR 01-24-2004 09:31 PM

Make sure you copy all the HTML and place it within a table under the navbar.

HTML Code:

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="70%" align="center">
code from zip
</table>


M.C. 01-24-2004 09:49 PM

thanx a lot! very quick ;) one more question - how to make more letters to be awailable from thread name? I mean now it look like:

New thread Last post: today 21:11 from M.C. replyes: 5 >> views: 10
New thread abou... Last post: today 21:11 from M.C. replyes: 5 >> views: 10

I want to see more here like: New thread about new style...
Where to change amount of letters?

Thanks!

NTLDR 01-24-2004 09:57 PM

In index.php find:

PHP Code:

$thread['title'] = fetch_censored_text(fetch_trimmed_title(unhtmlspecialchars($thread['title']), 22)); 

Change 22 to the number of characters you want.

M.C. 01-24-2004 10:10 PM

Thanks a million! Great job! Click install! Good Luck!


All times are GMT. The time now is 04:43 PM.

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.01440 seconds
  • Memory Usage 1,836KB
  • 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
  • (5)bbcode_html_printable
  • (5)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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