Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

help with bbcode [code]

Asked Modified Viewed 4,109 times
C
CursedSoul
C
  • Junior Member, joined since
  • Contributed 34 posts on the community forums.
  • Started 12 threads in the forums
  • Started this discussions
asked
Junior Member

Hello everybody,
I've got problem. In my web page, I decided to make article.php for tutorials in my php-fusion. The problem is that for some of the tutorials I've to put html code but my
 button doesn't shows up.
I am sure that is turned on from the admin panel/bb codes and I activated but it is still not showing up.
What can I do ?

Thanks.

P.S. the code that I wanna insert is -

[code]openside("Реклама");?>

<?
$ban = 4; //&#1090;&#1091;&#1082; &#1089;&#1077; &#1079;&#1072;&#1076;&#1072;&#1074;&#1072; &#1073;&#1088;&#1086;&#1103; &#1085;&#1072; &#1073;&#1072;&#1085;&#1077;&#1088;&#1080;&#1090;&#1077;, &#1074; &#1089;&#1083;&#1091;&#1095;&#1072;&#1103; &#1090;&#1077; &#1089;&#1072; 4
$banner = rand(1, $ban);
if ($banner == 1) echo "<A HREF='http://url'><IMG SRC='http://&#1073;&#1072;&#1085;&#1085;&#1077;&#1088;/images/banners/wt.jpg' BORDER='0'></A>" ;
elseif ($banner == 2) echo "<A HREF='http://url'><IMG SRC='http://&#1073;&#1072;&#1085;&#1085;&#1077;&#1088;/images/banners/wt.jpg' BORDER='0'></A>" ;
elseif ($banner == 3) echo "<A HREF='http://url'><IMG SRC='http://&#1073;&#1072;&#1085;&#1085;&#1077;&#1088;/images/banners/wt.jpg' BORDER='0'></A>" ;
elseif ($banner == 4) echo "<A HREF='http://url'><IMG SRC='http://&#1073;&#1072;&#1085;&#1085;&#1077;&#1088;/images/banners/wt.jpg' BORDER='0'></A>" ;
?>

<?closeside();
0 replies

14 posts

C
CursedSoul
C
  • Junior Member, joined since
  • Contributed 34 posts on the community forums.
  • Started 12 threads in the forums
  • Started this discussions
answered
Junior Member

And I was thinking that this forum should be official support forum... whatever...
0 replies
K
Kristian Thorsen
K
Carne Diem - Seize the MEAT
  • Member, joined since
  • Contributed 164 posts on the community forums.
  • Started 26 threads in the forums
answered
Member

This is a supportforum, but try the mods site instead.
Edited by Kristian Thorsen on 22-03-2009 22:08,
0 replies
C
CursedSoul
C
  • Junior Member, joined since
  • Contributed 34 posts on the community forums.
  • Started 12 threads in the forums
  • Started this discussions
answered
Junior Member

Quote

Kristian Thorsen wrote:
1. Take it easy
2. Get some credit by being a regular user instead of putting demands after only being a member for 3 month.

I really wouldn't help you after this comment


It doesn't matter for how long have I been a user, the important think is that I AM AN USER, if that CMS want to keep there users it the administrators have to help to all of them not only to that one who are staying her for more longer... By your post I understand that you are just one selfish guy who is trying to say that he is the smartest ok good be the smartest guy in the forum but after a year don't be disapointed if only you are here.

Sorry about my spelling mistakes I can corrected but I don't want to.

From now on that cms is with 1 user less.
Edited by CursedSoul on 22-03-2009 21:01,
0 replies
U
Ugleh
U
Ugleh 10
  • Member, joined since
  • Contributed 160 posts on the community forums.
  • Started 27 threads in the forums
answered
Member

Kristian, that's the wrong way to go. We are here to help them.

Now Cursed. Please post the HTML Code you want and ill be sure to make it for you. Also if you need anymore help, or want to do it yourself please check out my Video ive created below/

[youtube]8Q7jbj47ZXU[/youtube]
Edited by Ugleh on 22-03-2009 22:00,
0 replies
C
CursedSoul
C
  • Junior Member, joined since
  • Contributed 34 posts on the community forums.
  • Started 12 threads in the forums
  • Started this discussions
answered
Junior Member

Quote

Qwertz wrote:
Kristian, that's the wrong way to go. We are here to help them.

Now Cursed. Please post the HTML Code you want and ill be sure to make it for you. Also if you need anymore help, or want to do it yourself please check out my Video ive created below/

[youtube]8Q7jbj47ZXU[/youtube]


Hi Qwertz, my problem is that I want to have the bb code called "code" in the field where I am writing the articles. So I can put html or php code in the articles without making the code active.

For example I want to put this code in an article -

openside("Ads");?>

<?
$ban = 4; // how many banners
$banner = rand(1, $ban);
if ($banner == 1) echo "<A HREF='http://url'><IMG SRC='http://banner/images/banners/wt.jpg' BORDER='0'></A>" ;
elseif ($banner == 2) echo "<A HREF='http://url'><IMG SRC='http://banners/images/banners/wt.jpg' BORDER='0'></A>" ;
elseif ($banner == 3) echo "<A HREF='http://url'><IMG SRC='http://banners/images/banners/wt.jpg' BORDER='0'></A>" ;
elseif ($banner == 4) echo "<A HREF='http://url'><IMG SRC='http://banners/images/banners/wt.jpg' BORDER='0'></A>" ;
?>

<?closeside();


That is just one of the codes that I want to post like an article. It is a simple banner rotator. But when I am writing the articles there is no the bbcode "code" so when I put that code inside of my article the code is active..

I saw your video but I didn't work it out yet because I am busy. I will try later on today.

Thanks for your help.
0 replies
U
Ugleh
U
Ugleh 10
  • Member, joined since
  • Contributed 160 posts on the community forums.
  • Started 27 threads in the forums
answered
Member

I sugest using custom pages then, They allow html and php.

Because im not gooing to create every single one you want, And i cant make a BBCode that allows php or html in its brackets.
0 replies
C
CursedSoul
C
  • Junior Member, joined since
  • Contributed 34 posts on the community forums.
  • Started 12 threads in the forums
  • Started this discussions
answered
Junior Member

I was thinking about using custom pages as well but first I wanted to write here so if there is any other way, so if there is no other way I will do it in custom pages.

Thanks for your time Qwertz!
0 replies
U
Ugleh
U
Ugleh 10
  • Member, joined since
  • Contributed 160 posts on the community forums.
  • Started 27 threads in the forums
answered
Member

BBCodes are able to be used by every member of the site, even threw forums, and signatures. Only way is to put a if else statement for the users, and im not sure if thats possible.
0 replies
H
Homdax
H
Homdax 10
  • Fusioneer, joined since
  • Contributed 2,247 posts on the community forums.
  • Started 108 threads in the forums
answered
Fusioneer

Good call Qwertz. Cursed, you should allow more than just 3 hours for any kind of reply. Kristian has a point, but so does Qwertz. The rule-of-thumb falls in between.
0 replies
U
Ugleh
U
Ugleh 10
  • Member, joined since
  • Contributed 160 posts on the community forums.
  • Started 27 threads in the forums
answered
Member

she edited her post, but i didnt notice Curse bumped. but yea,

I mean Creating a BBcode only able to be used by admins have never been done before, Ill see if i can make it possible.
0 replies
U
Ugleh
U
Ugleh 10
  • Member, joined since
  • Contributed 160 posts on the community forums.
  • Started 27 threads in the forums
answered
Member

delete
Edited by Ugleh on 25-03-2009 00:48,
0 replies
D
Daywalker
D
"Might and Greed will never outweigh Honor and Loyalty"

Come join us for IRC Support: Here
  • Member, joined since
  • Contributed 152 posts on the community forums.
  • Started 31 threads in the forums
answered
Member

As per the Code of Conduct bumping is not allowed. If the thread becomes inactive to the point that after 7 days nothing has been written you can post or "bump" the thread. Further violations might end up with threads being deleted, or account suspension.

Quote

2.6 Double posting and "bumping" are not allowed

Double posting is not wanted. A thread shall never be posted in more than one forum or on more than one support site at the same time. Edit your last post if you have something to add to the thread. The one and only exception of this rule is when your thread is no longer active and new information has been brought up. A thread is not active when there has not been active for at least a week (7 days).


So count this as a warning as well as help.

adding bbcodes funcionality to articles is quite easy.

If you want to add the parsing of bbcodes into your articles, find articles.php in your main directory(The one with maincore.php and config.php)

look for:

$article = stripslashes($data['article_article']);


and change to:

$article = stripslashes($parseubb($data['article_article']));


Now you'll want to again add it to the admin area so that you can add the bbcodes. Again an easy task.

open administration/articles.php

Find:

require_once "../maincore.php";


add below it:

require_once INCLUDES."bbcode_include.php";


then find:


         echo "<tr>\n<td class='tbl'></td>\n<td class='tbl'>\n";
         echo display_html("inputform", "body", true, true, true, IMAGES_A);
         echo "</td>\n</tr>\n";



and turn it into:

      
         echo "<tr>\n<td class='tbl'></td>\n<td class='tbl'>\n";
         echo display_html("inputform", "body", true, true, true, IMAGES_A);
         echo "</td>\n</tr>\n";
         echo "<tr>\n<td class='tbl'></td>\n<td class='tbl'>\n";
         echo display_bbcodes("inputform", "body");
         echo "</td>\n</tr>\n";



now find:

         echo "<tr>\n<td class='tbl'></td><td class='tbl'>\n";
         echo "<input type='button' value='".$locale['432']."' class='button' style='width:80px;' onclick=\"insertText('body2', '<--PAGEBREAK-->');\" />\n";
         echo display_html("inputform", "body2", true, true, true, IMAGES_A);
         echo "</td>\n</tr>\n";


and add make it look like:


         echo "<tr>\n<td class='tbl'></td><td class='tbl'>\n";
         echo "<input type='button' value='".$locale['432']."' class='button' style='width:80px;' onclick=\"insertText('body2', '<--PAGEBREAK-->');\" />\n";
         echo display_html("inputform", "body2", true, true, true, IMAGES_A);
         echo "</td>\n</tr>\n";
         echo "<tr>\n<td class='tbl'></td><td class='tbl'>\n";
         echo display_bbcodes("inputform", "body2");
         echo "</td>\n</tr>\n";



Also find:


         $body = phpentities(stripslash($_POST['body']));
         $body2 = phpentities(stripslash($_POST['body2']));


and change them to:


         $body = phpentities(stripslash(parseubb($_POST['body'])));
         $body2 = phpentities(stripslash(parseubb($_POST['body2'])));


Now after modding all this you should be able to utilize ALL bbcodes in your articles and have the parsed when viewed by the user.

To make this even simpler for you, you can download pre-modded files from me at http://www.swc-factions.net/articles.zip
Edited by Daywalker on 27-03-2009 06:50,
0 replies
C
CursedSoul
C
  • Junior Member, joined since
  • Contributed 34 posts on the community forums.
  • Started 12 threads in the forums
  • Started this discussions
answered
Junior Member

Hi there,
I've tried your way but when I try to write [ code ]< a href="http://php-fusion.co.uk >PHPFusion Site< /a>[/ code]

and I pressed preview it shows me up only PHPFusion with the code tag around it but still it doesn't work.

When I press preview my code also became like that -
<div class='code_bbcode'><div class='tbl-border tbl2' style='width:400px'><strong>&#1050;&#1086;&#1076;</strong></div><div class='tbl-border tbl1' style='width:400px;white-space:nowrap;overflow:auto'><code style='white-space:nowrap'><a href=\"http://php-fusion\">php-fusion</a><br /><br /><br /></code></div></div>


I found another way to do it but It will be a lot more simpler if you can make it like that. Can you tell me how can I make it when I press the code icon to shows me not code /code but
<xmp></xmp>


Thanks!
0 replies
D
Daywalker
D
"Might and Greed will never outweigh Honor and Loyalty"

Come join us for IRC Support: Here
  • Member, joined since
  • Contributed 152 posts on the community forums.
  • Started 31 threads in the forums
answered
Member

I'm taking a look at the files and making some changes.

Update: It looks like the code bbcode itself was made specifically for the forum and thats why all other bbcodes work but code ones dont seem to.

Update: I was told that with the Code BBCode you had to stripinput. This means you will not be able to use HTML in your articles anymore. But with the use of all the bbcodes you should be able to do just what you would do with HTML with the bbcodes.

The files in my above link have been updated.
Edited by Daywalker on 27-03-2009 18:25,
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 14 posts
  • Votes 0 votes
  • Topic users 5 members

5 participants

K
K
Carne Diem - Seize the MEAT
  • Member, joined since
  • Contributed 164 posts on the community forums.
  • Started 26 threads in the forums
H
H
Homdax 10
  • Fusioneer, joined since
  • Contributed 2,247 posts on the community forums.
  • Started 108 threads in the forums
D
D
"Might and Greed will never outweigh Honor and Loyalty"

Come join us for IRC Support: Here
  • Member, joined since
  • Contributed 152 posts on the community forums.
  • Started 31 threads in the forums
U
U
Ugleh 10
  • Member, joined since
  • Contributed 160 posts on the community forums.
  • Started 27 threads in the forums
C
C
  • Junior Member, joined since
  • Contributed 34 posts on the community forums.
  • Started 12 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet