vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   vBExternal v1.6 (https://vborg.vbsupport.ru/showthread.php?t=83005)

[email protected] vbmenu_register("postmenu_1002448", true); 06-08-2006 08:34 PM

Ok, i where able to make it work, however, the problem is pretty strange.

Whenever I try to use the script from withing a PHP function it fails....

example.

Code:

test();

function test() {
  chdir('../forum');
  require_once('./vBExternal.php');
  output_News(3,51);
  output_NewestThreads(5,'');
  chdir('../pages');
}

That does not work and it returns

Fatal error: Call to a member function query() on a non-object in F:\Webz Inicom\Web iniCom\forum\vBExternal.php on line 392

if i run it from a non function, ie on a root of a file it just work fine

anyone can explain why or if there is any workaround?

C.Birch 06-09-2006 12:12 PM

I dont think its designed to work within other php code

C.Birch 06-09-2006 05:42 PM

Temp Fix for using with vb 3.6 beta1

In vBExternal.php

Find:
require_once('./includes/class_bbcode.php');

Replace with:
require_once('./includes/class_bbcode2.php');



Next you need to get the file class_bbcode.php from the vb3.5.4 and rename it class_bbcode2.php and then upload to includes folder.

Basicy it just makes this hack read the old bbcode file so that it works.

e2s 06-20-2006 12:13 PM

If on 3.5.4 you get a database error that gives you no idea what the problem is check this

Search for:
PHP Code:

// make database connection
$db->connect(
        
$config['Database']['dbname'],
        
$config['MasterServer']['servername'],
        
$config['MasterServer']['username'],
        
$config['MasterServer']['password'],
        
$config['MasterServer']['usepconnect'],
        
$config['SlaveServer']['servername'],
        
$config['SlaveServer']['username'],
        
$config['SlaveServer']['password'],
        
$config['SlaveServer']['usepconnect'],
        
$config['Mysqli']['ini_file']
); 

Replace with:
PHP Code:

// make database connection
$db->connect(
        
$config['Database']['dbname'],
        
$config['MasterServer']['servername'],
        
$config['MasterServer']['port'],
        
$config['MasterServer']['username'],
        
$config['MasterServer']['password'],
        
$config['MasterServer']['usepconnect'],
        
$config['SlaveServer']['servername'],
        
$config['SlaveServer']['port'],
        
$config['SlaveServer']['username'],
        
$config['SlaveServer']['password'],
        
$config['SlaveServer']['usepconnect'],
        
$config['Mysqli']['ini_file']
); 

You just need the port added and it should work or I should say it worked for me.

e2s 06-20-2006 04:18 PM

I recently made a modification so you can run multiple forums off of one user table. I have now modified the code for vBExternal so that I can have a site that shows recent posts from each site. You can check it out here. The site is still kind of rough and I am still working on getting everything the way I want it but you get the idea.

ElliottB 06-21-2006 06:08 AM

Is there any chance for news grabbing attachments and having them at the end?

aceofspades 06-30-2006 06:12 PM

can you tell me how to show how many members AND guests there are only. So far i have got the members online working but it would also be nice to show the number of guests.

something like :

Users online: 5
Members: James, Bob
Guests: 3

Dunc 07-02-2006 05:27 PM

I made a file called portal.php in my public_html folder which I'm gonna use to set it up and then put it as my main page. I did everything it said on installation instructions and I copied all of the usage instructions codes onto the page with lots of gaps between them

I must have done something wrong, because I get this message when I go on www.lolage.co.uk/portal.php:

Database error
The database has encountered a problem.

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

Please try the following:
Load the page again by clicking the Refresh button in your web browser.
Open the www.lolage.co.uk home page, then try to open another page.
Click the Back button to try another link.

The www.lolage.co.uk forum technical staff have been notified of the error, though you may contact them if the problem persists.

We apologise for any inconvenience.


I have no clue about php, so could someone help me?

Thanks :)

Tannerman 07-03-2006 04:47 PM

I was wondering if anyone has been successful in pulling information from MORE THAN ONE forum when using the News include. The instructions state:
Code:

###################################################
# Displaying News

<?php
output_News(5,4);
?>

# Change '5' to the amount you want to show
# Change '4' to the forum id you want to pull
# news from (must be set - only 1 forum id allowed)
###################################################

Just curious if anyone has been able to modify vBExternal so that more than 1 forum ID can be included here.

kidron 07-08-2006 03:09 PM

Quote:

Originally Posted by e2s
If on 3.5.4 you get a database error that gives you no idea what the problem is check this

Search for:
PHP Code:

// make database connection
$db->connect(
        
$config['Database']['dbname'],
        
$config['MasterServer']['servername'],
        
$config['MasterServer']['username'],
        
$config['MasterServer']['password'],
        
$config['MasterServer']['usepconnect'],
        
$config['SlaveServer']['servername'],
        
$config['SlaveServer']['username'],
        
$config['SlaveServer']['password'],
        
$config['SlaveServer']['usepconnect'],
        
$config['Mysqli']['ini_file']
); 

Replace with:
PHP Code:

// make database connection
$db->connect(
        
$config['Database']['dbname'],
        
$config['MasterServer']['servername'],
        
$config['MasterServer']['port'],
        
$config['MasterServer']['username'],
        
$config['MasterServer']['password'],
        
$config['MasterServer']['usepconnect'],
        
$config['SlaveServer']['servername'],
        
$config['SlaveServer']['port'],
        
$config['SlaveServer']['username'],
        
$config['SlaveServer']['password'],
        
$config['SlaveServer']['usepconnect'],
        
$config['Mysqli']['ini_file']
); 

You just need the port added and it should work or I should say it worked for me.


Thanks a lot! that solved my database error :banana:

saeedh 07-09-2006 03:41 AM

firstly, thanks e2s for noticing the fix :)
Quote:

Originally Posted by Tannerman
I was wondering if anyone has been successful in pulling information from MORE THAN ONE forum when using the News include. The instructions state:
Code:

###################################################
# Displaying News

<?php
output_News(5,4);
?>

# Change '5' to the amount you want to show
# Change '4' to the forum id you want to pull
# news from (must be set - only 1 forum id allowed)
###################################################

Just curious if anyone has been able to modify vBExternal so that more than 1 forum ID can be included here.

use the show threads option... it's the same thing however just able to do what you want which is pulling the newest 5 items from the array of forum ids

output_NewestThreads(X,"ID1,ID2,ID3,...");

X = number of items
IDx = the forum ids to which you want showing up :)

NeilFawcett 07-14-2006 11:09 AM

This is a VERY useful plugin. I'm particularly interested in the NEWS feature.

However, I've noticed if the threads have quotes (or code) defined in them, this text does make it out to the NEWS.

Ie: If you post a thread and within it do a quote of some text. When this thread is displayed as a news article, all the text is displayed apart from the quote :(

Any clues?

Tannerman 07-14-2006 02:31 PM

Quote:

Originally Posted by saeedh
Use the show threads option... it's the same thing however just able to do what you want which is pulling the newest 5 items from the array of forum ids

output_NewestThreads(X,"ID1,ID2,ID3,...");

X = number of items
IDx = the forum ids to which you want showing up :)

Thanks for the suggestion. I'd like to pull data from multiple forums like this, however I'd also like to have the entire post show (like the "News" option), rather than just the thread title (which the "Newest Threads") option uses.

Any suggestion on how to jimmyrig this to pull that off? :)

lightwave 07-14-2006 04:00 PM

what code do i ened to do if the file is in a different subdomain?

ZombieAndy 07-14-2006 06:49 PM

i know this has been asked several times and not answered, but it really is quite a problem. quotes, img's and codes dont work. does anyone know how to fix this?

A17roolz 07-16-2006 09:51 AM

With the correct modifications, this works a treat! Though I'm having trouble with emoticons not appearing...

EDIT: Nevermind, I found that I could get them working by changing the path of the smilies via the ACP from images/smilies/smiley.gif to http://www.domainname.com/bbs/images/smilies/smiley.gif

A17roolz 07-16-2006 09:02 PM

Sorry to double post, but does anyone know how to restrict the maximum number of characters in the title to 33? If it can leave a trailing ... that'd be a bonus.

chrisjp88 07-16-2006 11:00 PM

Quote:

Originally Posted by NeilFawcett
This is a VERY useful plugin. I'm particularly interested in the NEWS feature.

However, I've noticed if the threads have quotes (or code) defined in them, this text does make it out to the NEWS.

Ie: If you post a thread and within it do a quote of some text. When this thread is displayed as a news article, all the text is displayed apart from the quote :(

Any clues?

I need the fix for this too if anybody knows.

NeilFawcett 07-17-2006 11:17 AM

Quote:

Originally Posted by chrisjp88
I need the fix for this too if anybody knows.

So it's not just me then :)

Anyone please? Seems a bit of a problem that you can't put use QUOTE or CODE in any article to be published as news :(

What confuses me is the text in these tags seemingly doesn't even come out of the PHP script in any shape or form? It's just missing... Is it being lost on the way out of the SQL request? I suspect not... So where is it being lost :(

euangel 07-23-2006 07:02 AM

This mod is exactly what I need, but it's not working correctly for me. :( I'm trying to show the newest replies in the sidebar of a wordpress blog -- a php template. Unfortunately, I'm getting this error:

Fatal error: Call to a member function query() on a non-object in C:\Domains\broncosfreak.com\wwwroot\forum\vBExtern al.php on line 347

Any ideas?

HappyPike 07-24-2006 02:32 AM

Quote:

Originally Posted by GetGamer.com
Yes, this still works in 3.5.4.

By the way, a really, really nice additional module for this mod would plop a POLL on any external page (similar to the vBAdvanced poll module). Doable?

That would be wonderful!

HappyPike 07-24-2006 05:04 AM

Just found a problem... For some reason it doesn't parse vB codes:

I have a custom vB code for IMG tag with align option and it couldn't parse it in the news post.

[IMG=right]image url[/IMG]

:(

On the forum the tag works fine.

It also doesn't include stuff inside the [quote] tag.

Is there a fix for this?

chrisjp88 07-25-2006 04:01 PM

BTW. The maker of this mod hasn't posted since January, 7 months ago. I'm guessing he doesn't have an interest in vb anymore.

:(

I've been spending ages looking at all the files it uses, and can't find anywhere where it says to NOT use QUOTE tags.

The thing is it's such a HUGE flaw. So many news articles contain quotes, it's a must have. Does anybody know of a smilar script without such a flaw?

Tannerman 07-25-2006 09:05 PM

I've been using HTML blockquote tags combined with a horizontal rule to get around the issue, but then again, you need to have HTML enabled in the forum to make this work.

HappyPike 07-25-2006 09:15 PM

Yeah, that's the problem. I don't want to enable HTML in a forum where I want members to be able to post comments to the news items. if you don't allow comments, then enabling HTML is not a problem.

This hack is very easy to use but unfortunately it's not supported at all anymore. :(

rollo tamasi 07-25-2006 09:47 PM

hi, does this work with 3.5.4 at all? i installed this one and the other release and when i create a page feature the php code you gave i get "there is a problem with the db......" error messages

got haggis? 07-27-2006 12:28 AM

i have the same problem..also using 3.5.4

edit: duh, one page back (23) there is the answer that solved this.

Now, where can i modify <fieldset> so it doesn't span across the entire page.

NeilFawcett 07-27-2006 05:06 PM

Quote:

Originally Posted by chrisjp88
BTW. The maker of this mod hasn't posted since January, 7 months ago. I'm guessing he doesn't have an interest in vb anymore.

:(

I've been spending ages looking at all the files it uses, and can't find anywhere where it says to NOT use QUOTE tags.

The thing is it's such a HUGE flaw. So many news articles contain quotes, it's a must have. Does anybody know of a smilar script without such a flaw?

Quote:

Originally Posted by got haggis?
i have the same problem..also using 3.5.4

edit: duh, one page back (23) there is the answer that solved this.

Now, where can i modify <fieldset> so it doesn't span across the entire page.


Well, the problem is basically that the standard code that calls the BBCode parser and this will handle all the standard tags, but not some of the ones that require a template definitions for a forum. These include QUOTE and CODE.

To be honest this makes sense, as the template you probably use on your forum probably will not match the one you will use on your news page.


What I did was to simply process QUOTE tages (I'm not interested in CODE) ones prior to the BBCode parser call. Viola!


Here's my modified code (Due to BBCodes on these forums cocking stuff up I've changed the stuff below so QUOTE=ETOUQ)

Code:

// Load Template
$NewsTemplate = LoadTemplate("news.html");

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

$bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());

while($News = $db->fetch_array($NewestNews)){
        $neils_text = $News['pagetext'];

        // Convert QUOTE tag
        $convert_from = array("[ETOUQ]", "[/ETOUQ]",);
        $convert_to = array("<DIV CLASS=news-quote>", "</DIV>");
        $neils_text = str_replace($convert_from, $convert_to, $neils_text);

        // Convert BBCodes
        $neils_text = $bbcode_parser->do_parse(unhtmlspecialchars($neils_text), true, true, true);

        $Data .= ParseTemplate($NewsTemplate,
                array(
                'threadid'        => $News['threadid'],
                'threadname'        => $News['title'],
                'postusername'        => $News['postusername'],
                'post'                => $neils_text,
                'comments'        => vb_number_format($News['replycount']),
                'postdate'        => date( "l j-M-Y", $News['dateline']),
                )
        );
}

This isn't all my code - I've also put in stuff so I can ignore a thread, and also put a "more break" in so you could post a 10 page story, but put in a "more break" about 12 lines in, so the news page only displays upto that point. I'm also doing an "all news stories" thing as well...

For all my posting no one really helped me, so I hope this helps you!

ps: If you don't want to allow HTML conversion, then I guess you could disable that in the do_parse call, and instead replace the QUOTE tags with something else prior to the do_parse call, and then replace them again back to the HTML format afterwards... Just as long as you don't leave the QUOTE tags in there in their standard BBCode form before the do_parse call you'll be fine :)

jugo 07-27-2006 05:21 PM

I will upload my modified one which parses BBCode on every post no matter what...it even integrates with SEO.

NeilFawcett 07-27-2006 08:08 PM

Quote:

Originally Posted by jugo
I will upload my modified one which parses BBCode on every post no matter what...it even integrates with SEO.

Even Quote & Code tags? How does know which template to use?

chrisjp88 07-29-2006 12:22 AM

Neil, thanks a lot. Had I spent more time playing with vB rather than IPB I probably could have figured that out, but I didn't. :p
Thanks for sorting that out though, my friend is now happy with the news script.. and I don't have to find an alternative or write my own now :)

NeilFawcett 07-29-2006 01:40 PM

Quote:

Originally Posted by chrisjp88
Neil, thanks a lot. Had I spent more time playing with vB rather than IPB I probably could have figured that out, but I didn't. :p
Thanks for sorting that out though, my friend is now happy with the news script.. and I don't have to find an alternative or write my own now :)

That did the trick for you did it? Excellent...

HappyPike 07-29-2006 03:25 PM

Can you make it parse more than one BBCode? For example, I have an image tag with align option tag that also doesn't get parsed.

NeilFawcett 07-30-2006 04:41 PM

Must admit never tried an alignment... Got an example of what's not working? Does it work without the align?

HappyPike 07-30-2006 05:08 PM

Yeah, the regular img tag works. But when align option is provided, the script doesn't parse the code.

https://vborg.vbsupport.ru/

XtremeCrash 08-01-2006 11:16 AM

HI I get this error when add the codes:

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/crash74/public_html/xtremecrash/right.php on line 104

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/crash74/public_html/xtremecrash/right.php on line 227

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/crash74/public_html/xtremecrash/right.php on line 271

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/crash74/public_html/xtremecrash/right.php on line 308

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/crash74/public_html/xtremecrash/right.php on line 360

Ive been tring for the last few days to get it to and I have searched the forums top to bottom tring to figure this out. Any help will.

NeilFawcett 08-01-2006 04:15 PM

Quote:

Originally Posted by HappyPike
Yeah, the regular img tag works. But when align option is provided, the script doesn't parse the code.

[img=right]image_url[/img]

That's invalid syntax isn't it?

The closest you can get is?
[right][img]https://vborg.vbsupport.ru/[/img][/right]

Isn't it?

HappyPike 08-01-2006 07:02 PM

No, I made a custom img tag with align option. See this thread:

https://vborg.vbsupport.ru/showthread.php?t=122660

This way you can align images left or right w/o turning on HTML. :)

NeilFawcett 08-01-2006 08:31 PM

Quote:

Originally Posted by HappyPike
No, I made a custom img tag with align option. See this thread:

https://vborg.vbsupport.ru/showthread.php?t=122660

This way you can align images left or right w/o turning on HTML. :)

Well, all I can suggest you do it find occurences of [IMG=RIGHT] and replace that yourself prior to the BBCode call. Obviously where you find an occurence, you'll have to find the next [/IMG] tag to get the URL etc.

Would only take a dozen lines of code or so...

That or don't allow that tag in your news items...

By the way, I've found my home groan "More break marker" very handy... I'll PM you about that!

HappyPike 08-02-2006 06:10 AM

Thanks again for sharing the find, Neil. :up: Following your example I should be able to parse any BB code the script is not able to.


All times are GMT. The time now is 06:01 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.01905 seconds
  • Memory Usage 1,888KB
  • 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
  • (4)bbcode_code_printable
  • (4)bbcode_php_printable
  • (12)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