vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Parse BBCode (https://vborg.vbsupport.ru/showthread.php?t=117622)

mrTip 06-05-2006 12:32 AM

EXCELLENT! Thank you SOOO much for your help. ;) I cannot tell you how much I want to syndicate news -- and now we've done it!

Thanks again. For your paitence too.

calorie 06-05-2006 12:36 AM

Glad you have it working. :)

mrTip 06-05-2006 04:31 PM

Hello,

I have yet another question. Is there a way to display a custom message if the board is offline? Because if the board is offline, it replaces the WHOLE page with the "vBulletin Message - Board Offline" page, which is not good.

Smilies also seem to have some trouble displaying themselves. They try and pull the images from images/smilies, but because my page is in the '/beta/' directory, it pulls it from /beta/images/smilies, which is an invalid URL. How can I correct the image path for the smilies on my syndicated news page?

calorie 06-05-2006 09:56 PM

Custom Message:
Code:

// plugin at global_start hook

if (THIS_SCRIPT == 'news_index' AND !$vbulletin->options['bbactive'])
{
        // either turn board on or set custom message
        // $vbulletin->options['bbactive'] = 1;
        // $vbulletin->options['bbclosedreason'] = 'msg';
}

Smilie Image Path:
Code:

// set a replacement variable

images/smilies/ => http://www.domain.com/forum/images/smilies/


mrTip 06-05-2006 10:29 PM

Err, where should I put that 'custom message' piece of coding? I have it right under the require_once(global.php), but it doesn't seem to be turning the board on.

EDIT: I'm a complete n00b to modding vB, so I have no idea what do to with that smilie image path piece of coding. Again, thank you for your paitence!

calorie 06-05-2006 11:27 PM

1) Go to vB ACP -> Plugin System -> Add New Plugin:
Code:

Product: vBulletin
Hook Location: global_start
Title: news_index active
Plugin PHP Code: code is below
Plugin is Active: Yes

if (THIS_SCRIPT == 'news_index' AND !$vbulletin->options['bbactive'])
{
        // either turn board on or set custom message
        $vbulletin->options['bbactive'] = 1;
        // $vbulletin->options['bbclosedreason'] = 'msg';
}

2) Go to vB ACP -> Styles & Templates -> Replacement Variable Manager -> Add New Replacement Variable:
Code:

Style: your choice
Search for Text: images/smilies/
Replace with Text: http://www.domain.com/forum/images/smilies/

Tip: also check out the vB online manual :)

mrTip 06-06-2006 01:54 PM

Plugin works and I think the replacement variable manager works too, but it doesn't seem to be replacing the URL of the smilies on that news script.

calorie 06-06-2006 02:23 PM

If you are going to use a replacement variable, try the following:
Code:

/* do one of the following */

$pagetext = process_replacement_vars($pagetext); // and then you echo

/* or */

eval('print_output($pagetext);'); // does process_replacement_vars and echoes for you

/* or */

eval('print_output("' . fetch_template('your_template') . '");'); // where your_template has $pagetext in it

Otherwise be rid of the replacement variable and do something like:
Code:

$pagetext = str_replace('images/smilies/', 'http://www.domain.com/forum/images/smilies/', $pagetext); // and then you echo

Star* 11-08-2006 09:38 PM

thank you gents :)

tassoman 03-12-2007 10:58 PM

Hi to all, I'm trying to write a method for a MVC framework. But when i'm writing the news method i get this error:

Code:

Fatal error: Call to a member function query_first() on a non-object in /var/www/forum/htdocs/includes/functions.php on line 1041


All times are GMT. The time now is 03:36 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.01423 seconds
  • Memory Usage 1,745KB
  • 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
  • (7)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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