I’m begging for a simple plugin…
-
Hi, I just started using wordpress. I’m very impressed! Currently I’m trying to find a way to use this php program with it. It’s just custom bbcode really. All I would need is a plugin to parse it. I have looked around their website, and have read many many topics. But for the life of me i can’t find a solution. It’s been done with joomla, and lots of other software, with minimal work.
So, I thought i would try the peoples here at wordpress
The software is called gwbbcode. Here is their link
If u see this code its very simple to get it working. `<html><head></head><body>
<?php
if (!defined(‘GWBBCODE_ROOT’)) {
define(‘GWBBCODE_ROOT’, ‘full_path_to/gwbbcode’);
require_once(GWBBCODE_ROOT.’/gwbbcode.inc.php’);
}
echo parse_gwbbcode(“blabla
[build prof=Mo][Word of Healing][/build]”);
?>
</body></html>`
But can I have someone make me a plugin to parse[build prof=Mo][Word of Healing][/build]
-
Here is a plugin for joomla can we convert this?
`<?php
/**
* @version $Id: gwBBCode.php 2999 2007-02-16 21:45:00Z $
* @license https://www.gnu.org/copyleft/gpl.html GNU/GPL
*/// no direct access
defined( ‘_VALID_MOS’ ) or die( ‘Restricted access’ );$_MAMBOTS->registerFunction( ‘onPrepareContent’, ‘botgwBBCode’ );
/**
* gwBBCode Mambot
*
*{moscode}...some code...{/moscode}
*/
function botgwBBCode( $published, &$row, &$params, $page=0 ) {
//define(‘SMF’, 1);
require_once( $GLOBALS[‘mosConfig_absolute_path’] . ‘/gwbbcode/gwbbcode.php’ );
// simple performance check to determine whether bot should process further
if ( strpos( $row->text, ‘[‘ ) === false ) {
return true;
}// perform the replacement
$row->text = parse_gwbbcode( $row->text );return true;
}
?>`WoW Support ROX!
Plz any help for making a simple plugin for anytime i use [sometext] it will parse what between the [brackets]
the software (gwbbcode) does all the work i just need a way to plug it into wordpress >.>
<?php if (!defined('GWBBCODE_ROOT')) { define('GWBBCODE_ROOT', 'full_path_to/gwbbcode'); require_once(GWBBCODE_ROOT.'/gwbbcode.inc.php'); } echo parse_gwbbcode("blabla [build prof=Mo][Word of Healing][/build]"); ?>
Maybe I can try to take some php lessons, but ill tell ya i tend to break things!
So any thoughts on how to get parse_gwbbcode to parse when somone uses brackets [this is what gwbbcode parses] in content?
The phpexe plugin will not work for me as only admins can post php code into content.
Would be much easier to make a plugin that shows wordpress where gwbbcode is on the server, and then lets gwbbcode parse_gwbbcode when [ ]’s are used in content.
I am very persistant , and I will be here all day.. ??
Iv’e managed to find this I’m think maybe with a little tweeking we can get it to work for gwbbcode.
function Wp_UCanHide($text) { global $user_ID; if ($user_ID == '') { $posdebut = strpos($text, '[hide]'); $posfin = strpos($text, '[/hide]'); $texttohide = substr($text,$posdebut,$posfin); $text = str_replace($texttohide, "", $text); return $text; }else{ $text = str_replace('[hide]', "", $text); $text = str_replace('[/hide]', "", $text); return $text; } } // Apply the filters, to get things going add_filter('the_content', 'Wp_UCanHide'); ?>
Of course changing the Wp_UCanHide to Wp_gwbbcode, and instead of hiding the text between [hide] [/hide] lets gwbbcode_parse text between [, and ] .
Is that possible, i mean i know we will have to
define('GWBBCODE_ROOT', 'full_path_to/gwbbcode'); require_once(GWBBCODE_ROOT.'/gwbbcode.inc.php');
Please help me b4 i break my server… 8-(
PLEASE HELP ME IM NO GOOD AT CODING, I HAVE NO IDEA WHAT IM DOING ACTUALLY….
GAH!!!!!
Look at my avatar im pulling out my hair!
your constant bumping isnt going to help your cause – it’s the online equivalent of nagging.
Well if i dont do the constant bumping, my topic just gets lost in this forum. At least im actually attempting to write a plugin to do this. Thx for the tips and support on the matter reguardless.
@t_clauss: I don’t think that’s always true on the WP forums – quite often, if I see multiple replies to a thread, I presume it’s resolved.
For your information, you can assign users other than admins to include PHP code using Exec PHP combined with Role Manager. See the information page for ExecPHP for more info:
https://bluesome.net/post/2005/08/18/50/#requirementsI am aware of the plugin that u can get to use with Exec PHP to allow other users then admin to post php code. However It would be easier for my members if they didnt have to use the php code syntax.
So by making a filter, for the hook gwbbcode_parse to allow gwbbcode to parse everything between [, and ] would be much easier. I just dont know how to go about doing it. As I am no php programmer.
I am prolly not making any sence because i have no clue about php. I am trying my best to learn. I’ve been reading about making plugins but i just get lost when they start to say things like hooks, actions, and what not.
All that I know is that for gwbbcode to work u need is to include a file from gwbbcode, then tell it what to parse. By using gwbbcode_parse
I would also imagine that it would have to check if [some text is being used] then tell gwbbcode_parse to do its thing.
I tell ya what I am using TDO Mini Forms, to create a build directory. Basically i have made a form for members to submit data to a post. I have created a custom field called Build Code, that is where members use their gwbbcodes. In the form of [Eviscerate Paladin;OQMT00IK5xwyXRcSlqyPxfASAA] (this is just cut and pasted out of the game).
TDO Mini forms come with a form hacker, this is my form
<!-- Form 1 start --> %%FORMMESSAGE%% <!-- form start --> <form method="post" action="https://guildevil.byteact.com/wp-content/plugins/tdo-mini-forms/tdomf-form-post.php" id='tdomf_form1' name='tdomf_form1' class='tdomf_form' > %%FORMKEY%% <input type='hidden' id='tdomf_form_id' name='tdomf_form_id' value='1' /> <input type='hidden' id='redirect' name='redirect' value='%%FORMURL%%' /> <!-- widgets start --> <!-- content start --> <fieldset> <label for="content_title" class="required">Post Title (Required): <input type="textfield" name="content_title" id="content_title" size="23" value="<?php echo htmlentities($content_title,ENT_QUOTES,get_bloginfo('charset')); ?>" /> </label> </fieldset> <!-- content end --> <!-- customfields-1 start --> <fieldset> <?php $value = ""; if(isset($post_args['customfields-textfield-1'])) { $value = $post_args['customfields-textfield-1']; } ?> <label for="customfields-textfield-1" class="required">Build Code (Required) <input type="textfield" name="customfields-textfield-1" id="customfields-textfield-1" size="23" value="<?php echo htmlentities($value,ENT_QUOTES,get_bloginfo('charset')); ?>" /> </label> </fieldset> <!-- customfields-1 end --> <!-- customfields-2 start --> <fieldset> <?php $value = ""; if(isset($post_args['customfields-textarea-2'])) { $value = $post_args['customfields-textarea-2']; } ?> <label for="customfields-textarea-2">Description </label> <textarea title="true" rows="5" cols="19" name="customfields-textarea-2" id="customfields-textarea-2" ><?php echo htmlentities($value,ENT_NOQUOTES,get_bloginfo('charset')); ?></textarea> </fieldset> <!-- customfields-2 end --> <!-- categories start --> <fieldset> <?php $defcat = 1; if(isset($post_args['categories'])) { $defcat = $post_args['categories']; } ?> <label for='categories'>Select a category: <select name='categories' id='categories' class='tdomf_categories' size='1' > <option value="3"<?php if( (is_array($defcat) && in_array(3, $defcat)) || ( 3 == $defcat ) ) { echo ' selected="selected" '; } ?> >Warrior</option> <option value="4"<?php if( (is_array($defcat) && in_array(4, $defcat)) || ( 4 == $defcat ) ) { echo ' selected="selected" '; } ?> >Monk</option> <option value="5"<?php if( (is_array($defcat) && in_array(5, $defcat)) || ( 5 == $defcat ) ) { echo ' selected="selected" '; } ?> >Necromancer</option> <option value="6"<?php if( (is_array($defcat) && in_array(6, $defcat)) || ( 6 == $defcat ) ) { echo ' selected="selected" '; } ?> >Mesmer</option> <option value="7"<?php if( (is_array($defcat) && in_array(7, $defcat)) || ( 7 == $defcat ) ) { echo ' selected="selected" '; } ?> >Elementalist</option> <option value="8"<?php if( (is_array($defcat) && in_array(8, $defcat)) || ( 8 == $defcat ) ) { echo ' selected="selected" '; } ?> >Ranger</option> <option value="9"<?php if( (is_array($defcat) && in_array(9, $defcat)) || ( 9 == $defcat ) ) { echo ' selected="selected" '; } ?> >Assassin</option> <option value="10"<?php if( (is_array($defcat) && in_array(10, $defcat)) || ( 10 == $defcat ) ) { echo ' selected="selected" '; } ?> >Ritualist</option> <option value="11"<?php if( (is_array($defcat) && in_array(11, $defcat)) || ( 11 == $defcat ) ) { echo ' selected="selected" '; } ?> >Dervish</option> <option value="12"<?php if( (is_array($defcat) && in_array(12, $defcat)) || ( 12 == $defcat ) ) { echo ' selected="selected" '; } ?> >Paragon</option> </select> </label> </fieldset> <!-- categories end --> <!-- widgets end --> <!-- form buttons start --> <table border='0' align='left'><tr> <td width="10px"><input type="submit" value="Preview" name="tdomf_form1_preview" id="tdomf_form1_preview" onclick="tdomfSubmit1('preview'); return false;" /></td> <td width="10px"><input type="submit" value="Send" name="tdomf_form1_send" id="tdomf_form1_send" onclick="tdomfSubmit1('post'); return false;" /></td> </tr></table> <!-- form buttons end --> </form> <!-- form end --> <!-- Form 1 end -->
So could i change
<label for="customfields-textfield-1" class="required">Build Code (Required) <input type="textfield" name="customfields-textfield-1" id="customfields-textfield-1" size="23" value="<?php echo htmlentities($value,ENT_QUOTES,get_bloginfo('charset')); ?>" /> </label>
To
<label for="customfields-textfield-1" class="required">Build Code (Required) <input type="textfield" name="customfields-textfield-1" id="customfields-textfield-1" size="23" value="<?php echo gwbbcode_parse($value,ENT_QUOTES,get_bloginfo('charset')); ?>" /> </label>
If that would work, my problem would still be that if somone went to edit their post they would lose the gwbbcode, and by using the Exec PHP id have to assign them rights to post php, and they would have to use php syntax, which everyone doesnt know, Including me.
Isnt there just a simple way to make a filter or something for [anytext] That way users could not only use gwbbcode in the form that i made, but in posts/pages everywhere, and WordPress wont mess it up.
If I could just find a really really nice person, that is proficient with php, that could say here. This is how u check for [any text] in your content, and this is how u call an external app to use it.
It’s probably best to look up plugins that utilise custom brackets and see how they work.
Although, to be frank, if one isn’t familiar with PHP and has no working example to learn from, I think it’s going to be very difficult to create a plugin from scratch, so I’d suggest dissecting plugins which use these tags.
Sorry to sound a little rude, but I think the issue here (imho) is not really about ‘a really really nice person who is proficient with PHP’ to hold one’s hand, as even a really really nice person can get tired of having to deliver things on a platter.
p/s: Dagon Design is asking for new plugin requests here:
https://www.ads-software.com/support/topic/197381?replies=15support? what support didn’t you notice this board is for self notes only? ??
sigh currently with the new 2.6.2 out everyones busy fixing there own stuff ><
- The topic ‘I’m begging for a simple plugin…’ is closed to new replies.