vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced Links Directory > vBa Links Directory v3.0 Support > Modifications

Reply
 
Thread Tools Display Modes
  #21  
Old 06-03-2008, 08:54 PM
Lionel Lionel is offline
Senior Member
 
Join Date: Jan 2004
Location: Miami
Posts: 1,040
Default Re: Fake vBalinks as forum

sorry if this was confusing to you

Quote:
Create a forum and point it to your links index
__________________
Real useful and Cool vBulletin addons
Reply With Quote
  #22  
Old 06-15-2008, 05:35 PM
PhilMcKrackon's Avatar
PhilMcKrackon PhilMcKrackon is offline
Senior Member
 
Join Date: Apr 2008
Posts: 523
Default Re: Fake vBalinks as forum

I added this to my forums but I wanted the individual categories to show instead of one to the complete links section (since my site is based around links). http://www.legendarythreads.net/forums/

I'm concerned because I could not figure out a way to do this without repeating the code multiple times, this adds many queries per page load and I'm trying to lighten the query count. Is there a way to combine the code below into less queries?
PHP Code:
        if ($forum['forumid'] == '18')
                {
                global 
$db
                
$tot $db->query_first("SELECT COUNT(*) as count FROM " TABLE_PREFIX "adv_links WHERE catid = 17");
                
$link $db->query_first("SELECT linkid , name, posts, username, userid, dateline FROM " TABLE_PREFIX "adv_links WHERE catid = 17 ORDER BY linkid DESC");
                
$totpost $db->query_first("SELECT SUM(posts) as totpost FROM " TABLE_PREFIX "adv_links WHERE catid = 17");
                
$date vbdate($vbulletin->options['dateformat'], $link['dateline'], 1);
                
$time vbdate($vbulletin->options['timeformat'], $link['dateline']);        
                
$forum['lastpostinfo'] = '<div align="left" class="smallfont"><strong><a href="/showcase/showlink.php?do=showdetails&l='.$link[linkid].'">'.$link[name].'</a></strong><br />by <a href="member.php?find=lastposter&f='.$link[userid].'">'.$link[username].'</a><br /><span style="float:right;">'.$date.' '.$time.' <a href="/showcase/showlink.php?do=showdetails&l='.$link[linkid].'"><img src="http://www.legendarythreads.net/forums/smooth/buttons/lastpost.gif" border="0" alt="View showcase"></a></span></div>';
                
$forum['threadcount'] = $tot['count'];
                
$forum['replycount'] = $totpost['totpost'];
                }

        if (
$forum['forumid'] == '20')
                {
                global 
$db
                
$tot $db->query_first("SELECT COUNT(*) as count FROM " TABLE_PREFIX "adv_links WHERE catid = 7");
                
$link $db->query_first("SELECT linkid , name, posts, username, userid, dateline FROM " TABLE_PREFIX "adv_links WHERE catid = 7 ORDER BY linkid DESC");
                
$totpost $db->query_first("SELECT SUM(posts) as totpost FROM " TABLE_PREFIX "adv_links WHERE catid = 7");
                
$date vbdate($vbulletin->options['dateformat'], $link['dateline'], 1);
                
$time vbdate($vbulletin->options['timeformat'], $link['dateline']);        
                
$forum['lastpostinfo'] = '<div align="left" class="smallfont"><strong><a href="/showcase/showlink.php?do=showdetails&l='.$link[linkid].'">'.$link[name].'</a></strong><br />by <a href="member.php?find=lastposter&f='.$link[userid].'">'.$link[username].'</a><br /><span style="float:right;">'.$date.' '.$time.' <a href="/showcase/showlink.php?do=showdetails&l='.$link[linkid].'"><img src="http://www.legendarythreads.net/forums/smooth/buttons/lastpost.gif" border="0" alt="View showcase"></a></span></div>';
                
$forum['threadcount'] = $tot['count'];
                
$forum['replycount'] = $totpost['totpost'];
                } 
Thanks - and BTW - nice hack Lionel.
Reply With Quote
  #23  
Old 06-29-2008, 12:46 AM
ozidoggy ozidoggy is offline
Junior Member
 
Join Date: Jun 2008
Posts: 10
Default Re: Fake vBalinks as forum

Quote:
Originally Posted by Lionel View Post
Cool. You could also fine tune the date by adding the extra css to the span. I think it's class="time" . This way the font will be the same size with the rest of your dates, and make the link title "smallfont" as it appears to be "smallfont" in your forumhome
Can someone please explain to me how and where I place this piece of code?

Thanks

By the way GREAT mod!
Reply With Quote
  #24  
Old 06-29-2008, 07:06 AM
PhilMcKrackon's Avatar
PhilMcKrackon PhilMcKrackon is offline
Senior Member
 
Join Date: Apr 2008
Posts: 523
Default Re: Fake vBalinks as forum

Quote:
Originally Posted by ozidoggy View Post
Can someone please explain to me how and where I place this piece of code?
Look at my example just above your post. You can see where I have placed class="smallfont" to control the font size on the $forum['lastpostinfo'] line (3rd from last).
Reply With Quote
  #25  
Old 06-29-2008, 07:23 AM
ozidoggy ozidoggy is offline
Junior Member
 
Join Date: Jun 2008
Posts: 10
Default Re: Fake vBalinks as forum

Thanks Phil.....
Reply With Quote
  #26  
Old 06-30-2008, 05:12 PM
OneShot OneShot is offline
Junior Member
 
Join Date: Oct 2005
Posts: 7
Default Re: Fake vBalinks as forum

Would it be possible to make a Plugin out of this instead of modifying one of the files directly? I tried, unsuccessful tho. Its a neat little feature and I'd love to have it but since I want to keep my workload on updates small I refrain from using any hacks which involve hacking files directly.

Thanks
Reply With Quote
  #27  
Old 06-30-2008, 05:14 PM
Lionel Lionel is offline
Senior Member
 
Join Date: Jan 2004
Location: Miami
Posts: 1,040
Default Re: Fake vBalinks as forum

In order to make a plugin, you need a hook at a specific location. If there is no such hook, then a file edit is required if you want to use it.
__________________
Real useful and Cool vBulletin addons
Reply With Quote
  #28  
Old 10-18-2008, 11:59 PM
Janfri's Avatar
Janfri Janfri is offline
Junior Member
 
Join Date: Aug 2007
Location: Granada, Spain
Posts: 19
Default XHTML 1.0 Transitional

I installed this mod on my site and it works. But the problem for me is, that it is not valid XHTML 1.0 Transitional and gives me 22 errors on W3C, for example related to character "&" is the first character of a delimiter but occurred as data. I ask myself why so many mods here and on vbulletin.org are not XHTML 1.0 Transitional when vbulletin is. Wouldn't it be better to use the same language? I didn't validate my pages before and installed lots of mods. But when I validatet them the other day, I found over 200 errors on my homepage, and all because of the code of the mods. I would really like to use this solution for the link directory. So I would like to ask if you consider this important and if I can reinstall the mods anyway?
Best regards
Janfri
Reply With Quote
  #29  
Old 10-19-2008, 12:38 AM
Lionel Lionel is offline
Senior Member
 
Join Date: Jan 2004
Location: Miami
Posts: 1,040
Default

Simply replace
Quote:
div align="left"><strong><a href="/showcase/showlink.php?do=showdetails&l='.$link[linkid].'">'.$link[name].'</a></strong><br />by <a href="member.php?find=lastposter&f='.$link[userid].'">'.$link[username].'</a><br /><span style="float:right;">'.$date.' '.$time.' <a href="/showcase/showlink.php?do=showdetails&l='.$link[linkid].'"><img src="images/buttons/lastpost.gif" border="0" alt="View showcase"></a></span></div>
with (substituting the bold with your path and alt wording)

Quote:
div align="left"><strong><a href="/showcase/showlink.php?do=showdetails&amp;l=' . $link[linkid] . '">' . $link[name] . '</a></strong><br />by <a href="member.php?find=lastposter&amp;f=' . $link[userid] . '">' . $link[username] . '</a><br /><span style="float:right;">' . $date . ' ' . $time . ' <a href="/showcase/showlink.php?do=showdetails&amp;l=' . $link[linkid] . '"><img src="images/buttons/lastpost.gif" border="0" alt="View showcase" /></a></span></div>
99% of the time, one single error will cause the validator to be confused and display lots of errors.

So if a mod is causing 200 errors, you'll be surprised that fixing only the first one will change that 200 into a dastically lower errors, such as 5

Most of the mods that I posted for free are from my 9 years old site and that's not an important issue for me. If that is causing grief, then I will stop posting them.
__________________
Real useful and Cool vBulletin addons
Reply With Quote
  #30  
Old 10-19-2008, 01:00 AM
Janfri's Avatar
Janfri Janfri is offline
Junior Member
 
Join Date: Aug 2007
Location: Granada, Spain
Posts: 19
Thumbs up Validated code

Quote:
Originally Posted by Lionel View Post
So if a mod is causing 200 errors, you'll be surprised that fixing only the first one will change that 200 into a dastically lower errors, such as 5.
With your help my site has drastically lower errors now, not 5 but 0. The mod works perfectly and the page is validate without errors. Thanks bunches, that was very helpful. I'm afraid I will have to learn XHTML coding to be able to fix this kind of issues myself.
Best regards
Janfri
Reply With Quote
  #31  
Old 12-09-2008, 11:45 PM
dismas dismas is offline
Senior Member
 
Join Date: Jul 2007
Location: Vermont
Posts: 247
Thumbs up

I really like this hack!

Demo

I have just a couple small issues with it though. First, the date isn't showing up the same in my custom styles. And second, the 'lastpost' image isn't the same as in the rest of the style. For a better explanation, see the attached images...
Attached Images
File Type: jpg sosumi.jpg (12.1 KB, 13 views)
File Type: jpg blackandblue.jpg (12.0 KB, 11 views)
Reply With Quote
  #32  
Old 12-09-2008, 11:48 PM
Lionel Lionel is offline
Senior Member
 
Join Date: Jan 2004
Location: Miami
Posts: 1,040
Default

Simply edit the file to point your images to correct location. I used default vb folders
__________________
Real useful and Cool vBulletin addons
Reply With Quote
  #33  
Old 12-09-2008, 11:57 PM
dismas dismas is offline
Senior Member
 
Join Date: Jul 2007
Location: Vermont
Posts: 247
Default

But both styles don't use the same image. So, I don't understand how I would do that.
Reply With Quote
  #34  
Old 12-10-2008, 12:01 AM
Lionel Lionel is offline
Senior Member
 
Join Date: Jan 2004
Location: Miami
Posts: 1,040
Default

<img src="' . $stylevar['imgdir_button'] . '/lastpost.gif"
__________________
Real useful and Cool vBulletin addons
Reply With Quote
  #35  
Old 12-10-2008, 12:16 AM
dismas dismas is offline
Senior Member
 
Join Date: Jul 2007
Location: Vermont
Posts: 247
Default

Thanks! That's what I call quick service!

What about the text coloring issue though?
Reply With Quote
  #36  
Old 10-11-2010, 12:24 PM
adwade adwade is offline
Member
 
Join Date: Aug 2006
Location: Tennessee
Posts: 41
Default For vB v3.8.6PL1 & vBa LINKS Directory Product v3.3.0

Quote:
Originally Posted by ozwebsites View Post
Actually no they werent lol, well to me anyway.
Ditto! ha, ha But I kept reading through the thread until I finally figured it all out. Thanxx Lionel for taking the time/effort to post this information!

Here's the steps I ended up doing to get it working...

1)Created a new forum (#147 in MY case) with a Title of LINKS Library
Note: Our vBa LINK Directory Product is installed 'next to' our Forums Directory, not beneath it.
(i.e. /public_html/forums; /public_html/links and NOT: /public_html/forums/links)

2)Next in the Forum Link field (see Forums Manager in AdminCP), pointed it to the website's What's New Links index
(i.e. http://www.yourwebsite.com/links/whatsnew/links/)

In the forums/includes/functions_forumlist.php file

FIND
Code:
                $forum['lastpostinfo'] = '-';
Then place the following CODE below it, remembering to replace XX with YOUR new forumid(=147 in our case)
Code:
        if ($forum['forumid'] == 'XX')
                {
                global $db; 
                $tot = $db->query_first("SELECT COUNT(*) as count FROM " . TABLE_PREFIX . "adv_links");
                $link = $db->query_first("SELECT linkid , name, posts, username, userid, dateline FROM " . TABLE_PREFIX . "adv_links ORDER BY linkid DESC");
                $date = vbdate($vbulletin->options['dateformat'], $link['dateline'], 1);
                $time = vbdate($vbulletin->options['timeformat'], $link['dateline']);        
                $forum['lastpostinfo'] = '<div align="left"><strong><a href="/links/showlink.php?do=showdetails&l='.$link[linkid].'">'.$link[name].'</a></strong><br />by <a href="member.php?find=lastposter&f='.$link[userid].'">'.$link[username].'</a><br /><span style="float:right;">'.$date.' '.$time.' <a href="/links/showlink.php?do=showdetails&l='.$link[linkid].'"><img src="images/buttons/lastpost.gif" border="0" alt="View links"></a></span></div>';
                $forum['threadcount'] = $tot['count'];
                $forum['replycount'] = $link['posts'];                
                }
Note: Placing this code right after what I did a FIND for above, put it inside of a (seemingly) stray '}', but it seemed to work just fine.
Reply With Quote
  #37  
Old 02-21-2012, 08:20 AM
yamahapaul yamahapaul is offline
Member
 
Join Date: Feb 2009
Posts: 45
Default

This code from adwade seems to be the definitive solution for this, I've used it and it works just fine

Quote:
Originally Posted by adwade View Post
Code:
                $forum['lastpostinfo'] = '-';
Then place the following CODE below it, remembering to replace XX with YOUR new forumid(=147 in our case)
Code:
        if ($forum['forumid'] == 'XX')
                {
                global $db; 
                $tot = $db->query_first("SELECT COUNT(*) as count FROM " . TABLE_PREFIX . "adv_links");
                $link = $db->query_first("SELECT linkid , name, posts, username, userid, dateline FROM " . TABLE_PREFIX . "adv_links ORDER BY linkid DESC");
                $date = vbdate($vbulletin->options['dateformat'], $link['dateline'], 1);
                $time = vbdate($vbulletin->options['timeformat'], $link['dateline']);        
                $forum['lastpostinfo'] = '<div align="left"><strong><a href="/links/showlink.php?do=showdetails&l='.$link[linkid].'">'.$link[name].'</a></strong><br />by <a href="member.php?find=lastposter&f='.$link[userid].'">'.$link[username].'</a><br /><span style="float:right;">'.$date.' '.$time.' <a href="/links/showlink.php?do=showdetails&l='.$link[linkid].'"><img src="images/buttons/lastpost.gif" border="0" alt="View links"></a></span></div>';
                $forum['threadcount'] = $tot['count'];
                $forum['replycount'] = $link['posts'];                
                }
I did however modify it slightly so that the font is the same size and not bold to match the rest of the forum display (shown in blue)

Code:
        if ($forum['forumid'] == 'XX')
                {
                global $db; 
                $tot = $db->query_first("SELECT COUNT(*) as count FROM " . TABLE_PREFIX . "adv_links");
                $link = $db->query_first("SELECT linkid , name, posts, username, userid, dateline FROM " . TABLE_PREFIX . "adv_links ORDER BY linkid DESC");
                $date = vbdate($vbulletin->options['dateformat'], $link['dateline'], 1);
                $time = vbdate($vbulletin->options['timeformat'], $link['dateline']);        
                $forum['lastpostinfo'] = '<div align="left" class="smallfont"><strong><a href="/links/showlink.php?do=showdetails&l='.$link[linkid].'">'.$link[name].'</a></strong><br />by <a href="member.php?find=lastposter&f='.$link[userid].'">'.$link[username].'</a><br /><span style="float:right;">'.$date.' '.$time.' <a href="/links/showlink.php?do=showdetails&l='.$link[linkid].'"><img src="images/buttons/lastpost.gif" border="0" alt="View links"></a></span></div>';
                $forum['threadcount'] = $tot['count'];
                $forum['replycount'] = $link['posts'];                
                }
http://www.midlandsheritage.co.uk/


Reply With Quote
  #38  
Old 03-07-2012, 02:16 PM
yamahapaul yamahapaul is offline
Member
 
Join Date: Feb 2009
Posts: 45
Default

Its a shame that replys to links doesn't show and you just get a 0 in the posts column, I've tried everything I can think of to fix this grrr...
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fake stats help daddy20 Modifications (version 3.x & 2.x) 6 01-12-2007 10:32 PM
VBaLinks 2.0? interfx Pre-Sale Questions 117 10-02-2006 12:37 PM
Fake item in navigation. DonLKSAB "How Do I..." Questions 3 08-16-2006 09:48 AM
VBaLinks 1.01 interfx Pre-Sale Questions 15 07-29-2005 12:23 AM
vBaLinks Power Polo Pre-Sale Questions 3 12-15-2004 07:53 PM


All times are GMT -4. The time now is 11:12 PM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.