vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   What is wrong with my plugin? (https://vborg.vbsupport.ru/showthread.php?t=105922)

SnickersTK 01-21-2006 07:38 PM

What is wrong with my plugin?
 
Hook Location = Newpost_preview

PHP Code:

$bbcode_pattern '/\\[mod=(\\d+)\\]/';
$bbcode_replacement '<table width="90%" cellspacing="1" cellpadding="3" border="0" align="center">
<tr>
<td><span class="smallfont"><strong>Moderator Warning:</strong></span></td>
</tr>
<tr>
<td class="modscode"><img align="left" src="http://www.[Censored].com/UH/BBcodes/images/mod.gif">$1</td><tr></table> '
;
if(
preg_match($bbcode_pattern$previewmessage))
{
    
$previewmessage preg_replace($bbcode_pattern$bbcode_replacement ,$previewmessage);


If I write: [mod=test] and press preview, it just writes the exact same :(

oh this is the css I added:

Code:

.modscode{font-family: Courier, Courier New, Verdana, Arial;
        color: #465584;
        background-color: #FAFCFE;
        border: 1px dotted #000;
        padding: 2px;
        width:98%;
        margin: 0px auto 0px auto;
        /*overflow: auto;
        height: 200px;*/}

it doesn't do the code... unless I write numbers (Ex: 1,2,3,4)

Ok, how to make [high]d+[/high] into [high][a-z,A-Z,0-9][/high] and still having the code working ( $bbcode_pattern = '/\\[mod=(\\d+)\\]/'; )

and should I do anything about [high]$1[/high] ?

and if I didn't make it clear... I need to be able to write alot. Ex: [mod=look at me I am typing]

Thanks!

SnickersTK 01-31-2006 02:57 PM

any help?

amykhar 01-31-2006 03:46 PM

I think d+ should be w+ You'll need to consult a regular expressions reference to make sure.


All times are GMT. The time now is 11:14 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.03480 seconds
  • Memory Usage 1,720KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete