Custom BBCode - Help

Pages: 1, 2, 3
free web hosting

Read Latest Entries..: (Post #24) by iGuest on Apr 4 2008, 03:10 AM. (Line Breaks Removed)
Cannot Get Comedy Central Working on IPB Custom BBCode There appears to custom bbcode embed problem with comedy central. The Video works fine until I hit reply. I then get a message that the video is not longer available.-Luke WilburDcmessageboards.Com
Read the FIRST post of this Topic. - Express your Opinion! Contribute Knowledge :-).

Free Web Hosting > Astahost > Hosted Members Support > BBS Systems

Custom BBCode - Help

pyost
I though we could use a topic like this, where you could ask for help considering making custom BBCodes. I'll start first biggrin.gif

I was really inspired by the notice bbcode here on astahost. I wanted to put something like that on my IPB 2.0 forum, and of course, it was a total failure smile.gif

First I made a simple html code that creates a table with two rows, where in the first row it would say notice and in the second {content}. It worked properly in the testing part in ACP, but when I tried to use it in a topic, the table was... well, you'll see it on an examle in the end. I still have the same problem, but I started messing around with something more complicated.

Since I have no way of limiting the use of the tag to admins and mods (maybe you know of a way) I need a piece of code which would put the username of the person who is editing the post. Similar to the edited by legend, except I want only the username, and inside the table. The current code I am using looks like this.

CODE
<table width="350" border="0" align="center" cellpadding="2" cellspacing="0" bgcolor="#99000">
 <tr valign="middle">
   <td height="30" bgcolor="#99000">
     <div align="center"><font color="#FFFFFF"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Napomena</font></b></font></div>
     </td>
 </tr>
 <tr valign="top">
   <td bgcolor="#990000">
     <table width="350" border="0" cellspacing="0" cellpadding="5">
       <tr bgcolor="#FFFFFF" valign="top">
         <td width="350" bgcolor="#FFFFFF">
           <p><font face="Verdana, Arial, Helvetica, sans-serif" size="1">{content}</font></p></td>
       </tr>
 
 <tr valign="middle">
         <td bgcolor="#99000"> <div align="right"><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><b>[NAME]</b></font></div></td>
 </tr>
 
     </table>
     
   </td>
 </tr>
</table>


'Napomena' means notice wink.gif

As you can see, it is quite simple, but it still isn't working! Where it says name, IPB should put the username - I need your help with that. And, of course, I would be really happy if you could tell me why it isn't working in the topic view.

You can see how it looks over here:
http://www.forumiranje.com/forum/index.php...findpost&p=4776

 

 

 


Reply

Houdini
Although 2.0 allows you to create custom BB Code with the ACP is will probably need you to add some code other than what can be done with the ACP
Try putting the following into the Custom BB Code Replacement at the bottom in 2.0 and it will pretty much use the class as used by the CODE box
CODE
<div class='codetop'>NOTE</div><div class='codemain' style= white-space:pre;overflow:auto'><center>Napomena</center>{content}</div>
The above is basically the CODE tag replaced except with NOTE for the displayed text, to change the background et cetera then you need to make you a new css class here are the classes for the .codetop and .codemain to guide you along
CODE
.codetop,
.sqltop,
.htmltop
{
width:98%;
color: #000;
margin: 0px auto 0px auto;
font-weight:bold;
padding: 3px;
background-color:#FDDBCC;
background-image: url(1/css_img_code.gif);
background-position: right;
background-repeat: no-repeat;
}

.codemain,
.sqlmain,
.htmlmain
{
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;*/
}
That css is in the style_images/css_2.css folder so you would make a new class for background and all then alter your [note] code as shown above, you will probably have to use {username}
Here is what the above code would look like:

user posted image
Let me go back to hard code for BB Codes and I will help you with the 2.0 version I have been mostly using the 1.3 (which doesn't have that feature. It will take some time but hopefully what you have above will at least get you started.

 

 

 


Reply

pyost
The things with div work really good, it's showing the same as code, but I don't seem to have css_2.css. Furthermore, I can't find (when I search through files) that is the same as you wrote it here. I don't know what could be the problem, but if I solved that, I believe that I could handle some css, it looks easy smile.gif

Reply

Houdini
The css_2.css file is in the style_images folder see the illustration below, it and the index.htl file will be the only files in that folder;
user posted image
If you will read a little about making a CSS class say a .notecode and a .notebody just use the code that was included in the first post as an example of how classes are defined and as you saw in the code that I gave to use for the sample note if you make a new class and make up the font solor family size background color and all you will end up with what you want with the exception of the {username} which might be called by IPB a different way.

In your root folder with IPB 2.0 you should have the following folders;
cache, ipb_kernal, jscripts, lang, lofiversion, retal, skin_acp, skin_cache, sources, skin_acp, skin_cache,sources, style_avatars, style_emoticons,and style_images which is the folder that has the css_2.css, if there is a css file in yours by another name that is most likely the file you wont know til you open it up.

Reply

pyost
I'm not that stupid smile.gif I just don't get it, but when I search all the things in the upload folder (TC search *.css) I get three files for lofiversion and one in skin_acp. If I could find it I believe that I could do something, it looks quite understandable.

Reply

Houdini
To find that file use your Window search and just tell it to browse the 2.0 ipb folder, that is if you have the upload directory on your local hard drive (note) that file is created when you install IPB so if you have an uninstalled copy on your hard drive you will not see it. If you have cPanel on your host (I will assume you do and that you use astahost) just use file manager and look at the style_images folder and you should only see two files css_2.css and index,html and a 1 folder with a bunch of images.

Reply

pyost
This is so unbelievable! See for yourself, the attatched picture. There is one from the upload folder, one on the server, and one from cpanel.

Anyway, just to make sure i understood what I need to do if I somehow find that file.
I should create something like this and adjust it to my needs:

CODE
.notetop,
.sqltop,
.htmltop
{
width:98%;
color: #000;
margin: 0px auto 0px auto;
font-weight:bold;
padding: 3px;
background-color:#FDDBCC;
background-image: url(1/css_img_code.gif);
background-position: right;
background-repeat: no-repeat;
}

.notemain,
.sqlmain,
.htmlmain
{
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;*/
}


And then in the BBCode replacement put notetop and notemain, right?

I can change the size, the background image ('ph'), the background colour, font, etc. A few more questions.

CODE
color: #000;

CODE
border: 1px dotted #000;


Why are there only three characters here and not six?

CODE
/*overflow: auto;
height: 200px;*/


If I am not mistaken this is a comment, and not a part of the code. So, what does the comment want to say? smile.gif

Thanks a lot for this, you really cleared out some things to me.

Reply

Houdini
/* <---Everything inside the forward slash * (asterick) and a following -->[B]*/ is a comment normally used for multiple line instead of the // Comment for a single line[/B] If you were to uncomment the line in that code it would produce a 200 pixel box regardless of the lines in that box (a real waste of space) even if there were only one.

If you find the file it is possible that it is called something else because you might be using a different version and it is entirely possible that it is in another folder. What you need to do is review all the .css files because that is how the forum gets its information on how to display certain areas of the forum. It is possible to have one large .css file that contains all the information to set the style, and if that is the case then you would create your .notetop and .notebody within that file seperate from the other because your .notetop and notebody should have different characteristics from the html and sql boxes. You might want a solid border or a dashed border for your box, and you might want it to have different dimensions from other.

So you are on the right track and just need to find the .css that contains the html and sql classes in it and in that file is where you would, I will install that version on my site and see what it is that is going on because I believe that my 2.0 version is different than the one that astahost or in your case that you are using. Do you have a server on your local PC or Mac? It would help a lot if you did (it also needs at least PHP just to run PHP).

Reply

pyost
I don't have a home server, because I tried using xammp, and didn't like it a lot. But never mind, I have managed to solve the problem!

Since I wasn't able to find the css file, I looked at the index.php source code because I was hoping to find a link to the css file that it uses. What I found in there was the complete css structure between

CODE
<style type="text/css"></style>


So I decided to try something different. I thought that the BBCode would work if I put the custom css between the tags and into the BBCode replacement. It looked like this:

CODE
<style type="text/css">

.notetop,
.sqltop,
.htmltop
{
width:300px;
height:20px;
color: #000;
margin: 0px auto 0px auto;
font-weight:bold;
padding: 3px;
color: #FFFFFF;
background-color:#4A6A75;
background-image: url(http://www.astahost.com//style_images/1/note_back.gif);
background-position: left;
background-repeat: repeat;
}

.notemain,
.sqlmain,
.htmlmain
{
font-family: Courier, Courier New, Verdana, Arial;
color: #000000;
background-color: #CAD7DD;
border: 1px dotted #000;
padding: 2px;
width:300px;
margin: 0px auto 0px auto;
/*overflow: auto;
height: 200px;*/
}

</style>

<div class='notetop'>NAPOMENA</div><div class='notemain' style= white-space:pre;overflow:auto'>{content}</div>


And fortunately, it worked! Thanks a lot for you help, now I have a better understanding of css and how it is used. This will help me with building websites, I am sure!

Reply

Houdini
Great to hear about that , as you said css is not that difficult and makes it so you can create a class for just about anything you want and either import them or embed them into documents and where you want certain thing to happen just call that name in a tag where you want to use them.

Reply

Latest Entries

iGuest
Cannot Get Comedy Central Working on IPB
Custom BBCode

There appears to custom bbcode embed problem with comedy central. The Video works fine until I hit reply. I then get a message that the video is not longer available.

-Luke Wilbur
Dcmessageboards.Com

Reply

BuffaloHELP
Oh fantastic!!

I thought I would be asking too much of your time tongue.gif That's some good news!

I came back to share that using Firefox and Greasemonkey extension I think I might have found a workaround solution but modified NOTICE tag itself will do perfectly!

Thanks MC!!

PS, upon looking at the cookies I only find member_id which only shows my Member Number 10,610. Somehow I believe you know how to associate this information with my forum name?

Reply

mastercomputers
If you want automatic name insertion then why not ask?

I haven't worked on this notice BBCode since the javascript problems were sorted here (though I did clean it up even more, just the latest results never saw it here and I only have that on backup now, which I must hunt or just rewrite it again).

Without doing any serious PHP we can still grab the name, because IPB uses cookies, and stores the members name there and we can use javascript to grab it and insert it for us.

That should point you all in the right direction, but you can also wait for me (probably be done when I am not so busy, or during my breaks) to release the newer Notice BBCode which I'll drop here too.

Cheers,

MC

Reply

BuffaloHELP
I do not claim that I understand IP.B bbcodes and how it works (besides the things that I add them as JAVA SCRIPT under custom bbcode). But after looking at YOU bbcode tag at Invisionize I came to understand that it requires some serious PHP and database to make NOTE=USERNAME to be filled in automatically.

Somehow it looks for {$author['id']} and the session ID, doubled checked with post number and database entry to make RenderRow to show all other information: such as Username, Group, Posts, Joined, From...etc

This, I believe, means the NOTE tag must be synched with who is making the edit, the permission mask of this member, which post and reference with the forum's database.

At this time I am not willing to venture into this area laugh.gif I just thought that custom bbcode will let me use IPB's PHP variables but I guess not, i.e. NOTE={$author['id']} so to speak.

Reply

pyost
No, I haven't managed in doing so smile.gif I ended up copying the Astahost notice system where you use NOTE=USERNAME. However, a just thought of an idea that might as well work. I'll presume you need it when editing other people's posts, because that's the only way it can be used. Anyhow, when you edit someone's post, you have the choice to leave a message saying "Edited by...". So, why not combine the custom BBCode with that option? Of course, you would probably have to do some serious PHP editing, but it is worth trying.

Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Pages: 1, 2, 3
Recent Queries:-
  1. bbcode change background colour - 3.47 hr back. (1)
  2. vbulletin custom bbcode embed - 4.61 hr back. (1)
  3. bbcode help information - 10.93 hr back. (1)
  4. background-image bb-code - 14.61 hr back. (1)
  5. bbcode multi site search - 17.64 hr back. (1)
  6. picture as background bbcode - 17.78 hr back. (1)
  7. bb code keep spacing the same courier - 18.27 hr back. (1)
  8. background bbcodes - 30.13 hr back. (1)
  9. custom bbcode - 33.24 hr back. (1)
  10. bbcodes margin - 61.06 hr back. (1)
  11. bbcode background - 11.44 hr back. (2)
  12. background image bbcode - 71.27 hr back. (1)
  13. background tag bbcode - 82.21 hr back. (1)
  14. how to put php into custom bbcode vbulletin - 87.59 hr back. (1)
Similar Topics

Keywords : custom bbcode


    Looking for custom, bbcode

Searching Video's for custom, bbcode
advertisement




Custom BBCode - Help



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE