vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Major Additions - [ITech] vBExternal Lite (https://vborg.vbsupport.ru/showthread.php?t=147344)

JtChurch925 09-29-2007 07:08 PM

<sigh>

...bupkis, nothing, nada...

I assume this must have something to do with the fact that I am trying to display the information on the same page as the forum -and so you'd be right about it be a linkage (or directory) problem.

I also have a main page built in Joomla, and it will display there ok.
-of course the head code for that page is:
<?php
chdir('./forum');
require_once('./vBExternal.php');
?>

because it's a different directory.
but I drop in the php output code on that page and it works just fine.

but nothin' doin' on http://n81street.com/forum/index.php
hrmmm... :confused:

Koroku 09-29-2007 10:59 PM

I'm no master, but I don't think you need the chdir at all if you're including vBExternal.php in the same directory.

steveneff 09-30-2007 03:39 PM

Got this working in a nuke module.

in modules/mymodule/index.php

PHP Code:

chdir('./forum'); 
require_once(
'./vBExternal.php'); 
output_NewestThreads(5,'1,2,3');
chdir('../'); 


in vBExternal.php change each instance of $db to $vbdb

Not sure if this is the right thing to do but it works :)

Anyone know how to list a preview of each tread?

JtChurch925 09-30-2007 10:25 PM

Quote:

Originally Posted by Koroku (Post 1349885)
I'm no master, but I don't think you need the chdir at all if you're including vBExternal.php in the same directory.

Yep, if you check my posts you'll see I removed chdir for the forum page. Added it for the J!hompage.

Congrats on getting it working steveneff, I'm jealous, tried changing the $db to $vbdb and that didnt seem to help either.

:confused:

steveneff 10-01-2007 02:51 PM

I've managed to get the post text displayed with the code below but would now like to add the parent forum.

PHP Code:

    // ---------------------------------------------------
    // FUNCTION: output_NewestThreads
    // DETAIL:   Outputs X newest threads ordered by
        //           start date descending. $a
    //           specifies amount to show (Default 5)
        //           and $f can specify certain forums
    //           to grab from (1,3,4), by default it pulls
        //           from all forums.
    // ---------------------------------------------------

    
function output_NewestThreads($a 5,$f ""){
    global 
$db$Data$vbulletin;
    
    
// Define amount to show
    
$Amount = ($a)? intval($a) : 5;

    
// Define Forum(s) To Pull From
    
$Forums = ($f)? $f'';
    
$SQL    '';

        if(
$Forums){
        
$SQL " where forumid in({$Forums})";
        }

    
// Load Template
    
$Template LoadTemplate("newest_threads.html");

//     Collect Data
        
$NewestThreads $db->query("
            select t.*,p.pagetext
            from "
.TABLE_PREFIX."thread t
            left join "
.TABLE_PREFIX."post p on(p.postid=t.firstpostid)
            
{$SQL} 
            order by dateline desc
            limit 0,
$Amount");

        
$bbcode_parser =& new vB_BbCodeParser($vbulletinfetch_tag_list());

        while(
$Thread $db->fetch_array($NewestThreads)){
        
$Data .= ParseTemplate($Template,
                            array(
                                
'threadid'     => $Thread['threadid'],
                                
'threadname'   => $Thread['title'],
                                
'postuserid'   => $Thread['postuserid'],
                                
'postusername' => $Thread['postusername'],
                                
'post'         => $bbcode_parser->parse(unhtmlspecialchars
                                
(substr ($Thread['pagetext'],0,101)), $f), 

                                
'replies'      => vb_number_format($Thread['replycount']),
                                
'views'        => vb_number_format($Thread['views']),
                                
'lastposter'   => $Thread['lastposter'],
                            )
            );
        }

    
doOutput();
    } 


Anyone done this already?

bangthebook 10-01-2007 05:40 PM

What has to be edited to control the length of the thread title? I dont see an option and I havent seen it pointed out.

Also anyone get this working with VBSEO?

steveneff 10-01-2007 09:40 PM

Quote:

Originally Posted by bangthebook (Post 1350863)
What has to be edited to control the length of the thread title? I dont see an option and I havent seen it pointed out.

Try this, where 100 = amount of characters

PHP Code:

'threadname'   => (substr ($Thread['title'],0,100)) 


Stratto 11-04-2007 08:25 PM

I liked this, its really good! And easy to code, thanks ^^

Oh I don't know if anyone else has posted but I added a printable option and to reply to the post.

Add reply
Code:

<a href='{url}/newreply.php?do=newreply&noquote=1&p={threadid}'>
Comments: {comments}</a>

Print Article
Code:

<a href='{url}/printthread.php?t={threadid}' target='_new'> <small>Print Article</small></a>
Once again, thanks I've been looking for this since..forever XD

SilentNoise 11-08-2007 01:12 PM

Dude! You just made my year with this hack!

Goodbye vBAdvanced!.... you boxy, boooooring POS!

rwoscott 11-09-2007 07:16 AM

Finally got it to work, thanks mate.


All times are GMT. The time now is 10:23 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.01175 seconds
  • Memory Usage 1,770KB
  • 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
  • (3)bbcode_php_printable
  • (2)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
  • (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