Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
How can I change the buttons in the writing panel?

 
Reply to topic    Forum Index » Help View previous topic
View next topic
How can I change the buttons in the writing panel?
Author Message
Reddox



Joined: 19 Oct 2006
Posts: 17

Post How can I change the buttons in the writing panel? Reply with quote
I'm sorry the title isn't so good, but it was the best I could do.

I want to change the looks and the value of these buttons:


I want to change them, so that instead of putting for instance
Code:
<b></b>
into the form, they put something else. Any idea on how (and where) I can do this?
Thanks
Wed Sep 12, 2007 8:35 am View user's profile Send private message
Guest








Please login to hide the ads.

FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2668
Location: Germany

Post Reply with quote
They are in inc/functions.inc.php -> Function:inserttag (line 329).
Wed Sep 12, 2007 7:32 pm View user's profile Send private message
Reddox



Joined: 19 Oct 2006
Posts: 17

Post Reply with quote
Thanks for the quick reply. But when I played with the code, I couldn't open the admin panel at all. All I get is a white site. When I put back the old code, the problem disappeared.
Wed Sep 12, 2007 10:34 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2668
Location: Germany

Post Reply with quote
Well, you have to be carefull. But it's definitely possible to edit it.

For example, if you change this:
Quote:
<a href=\"javascript:insertext('<b>','</b>','$insert_location')


to this:
Quote:
<a href=\"javascript:insertext('<c>','</c>','$insert_location')


the button will insert <c> tags instead of <b> tags (which is quite useless as <c> tags don't exist).
Thu Sep 13, 2007 6:30 pm View user's profile Send private message
Reddox



Joined: 19 Oct 2006
Posts: 17

Post Reply with quote
Thanks again, I tried to just edit a little, but it didn't work.

Ok, this is how the code looks untouched:
Code:
$output = "
      <div class=\"tags\"><a href=\"javascript:insertext('<br />','','$insert_location')\" title='Linebreak'><img src=".$config_http_script_dir."/skins/images/tags/br.gif border=0 align=middle></a>
      <a href=\"javascript:insertext('<hr />','','$insert_location')\" title='Horizontal line'><img src=".$config_http_script_dir."/skins/images/tags/hr.gif border=0 align=middle></a>
      <a href=\"javascript:insertext('<p>','</p>','$insert_location')\" title='Paragraph'><img src=".$config_http_script_dir."/skins/images/tags/p.gif border=0 align=middle></a>
      <a href=\"javascript:insertext('<b>','</b>','$insert_location')\" title='Bold'><img src=".$config_http_script_dir."/skins/images/tags/b.gif border=0 align=middle></a>
      <a href=\"javascript:insertext('<i>','</i>','$insert_location')\" title='Italic'><img src=".$config_http_script_dir."/skins/images/tags/i.gif border=0 align=middle></a>
      <a href=\"javascript:insertext('<u>','</u>','$insert_location')\" title='Underline'><img src=".$config_http_script_dir."/skins/images/tags/u.gif border=0 align=middle></a>
      <a href=\"javascript:insertext('<s>','</s>','$insert_location')\" title='Linethrough'><img src=".$config_http_script_dir."/skins/images/tags/s.gif border=0 align=middle></a>
      <a href=\"javascript:insertext('<sub>','</sub>','$insert_location')\" title='Subscript'><img src=".$config_http_script_dir."/skins/images/tags/sub.gif border=0 align=middle></a>
      <a href=\"javascript:insertext('<sup>','</sup>','$insert_location')\" title='Superscript'><img src=".$config_http_script_dir."/skins/images/tags/sup.gif border=0 align=middle></a>
      <a href=\"javascript:insertext('<font color=&quot;&quot;>','</font>','$insert_location')\" title='Font color'><img src=".$config_http_script_dir."/skins/images/tags/color.gif border=0 align=middle></a>
      <a href=\"javascript:insertext('<font size=&quot;&quot;>','</font>','$insert_location')\" title='Font size'><img src=".$config_http_script_dir."/skins/images/tags/size.gif border=0 align=middle></a>
      <a href=\"javascript:insertext('<ul>','</ul>','$insert_location')\" title='List'><img src=".$config_http_script_dir."/skins/images/tags/ul.gif border=0 align=middle></a>
      <a href=\"javascript:insertext('<li>','</li>','$insert_location')\" title='List element'><img src=".$config_http_script_dir."/skins/images/tags/li.gif border=0 align=middle></a>
      <a href=\"javascript:insertext('<a href=&quot;http://&quot; target=&quot;_blank&quot;>','</a>','$insert_location')\" title='URL'><img src=".$config_http_script_dir."/skins/images/tags/url.gif border=0 align=middle></a>
      <a href=\"javascript:insertext('<a href=&quot;mailto:&quot;>','</a>','$insert_location')\" title='Email'><img src=".$config_http_script_dir."/skins/images/tags/mailto.gif border=0 align=middle></a>
      <a href=\"#\" onclick=\"window.open('$PHP_SELF?mod=images&area=$insert_location', '_Addimage', 'height=450,resizable=yes,scrollbars=yes,width=500');return false;\" target=\"_Addimage\"><img src=".$config_http_script_dir."/skins/images/tags/img.gif border=0 align=middle></a>
      <a href=\"javascript:insertext('<div align=&quot;&quot;>','</div>','$insert_location')\" title='Align'><img src=".$config_http_script_dir."/skins/images/tags/align.gif border=0 align=middle></a></div>";

return $output;


The only tags I need are: <b></b>, <i></i>, <u></u>, <s></s> and <br />.
I also need a tag that puts in: <p class="ptp"> </p>
and one that puts in: <img src="" class="pp" />

What should I do?
Fri Sep 14, 2007 9:56 am View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2668
Location: Germany

Post Reply with quote
Code:
function inserttag($insert_location){
global $config_http_script_dir;
      $output = "
      <div class=\"tags\"><a href=\"javascript:insertext('<br />','','$insert_location')\" title='Linebreak'><img src=".$config_http_script_dir."/skins/images/tags/br.gif border=0 align=middle></a>
      <a href=\"javascript:insertext('<b>','</b>','$insert_location')\" title='Bold'><img src=".$config_http_script_dir."/skins/images/tags/b.gif border=0 align=middle></a>
      <a href=\"javascript:insertext('<i>','</i>','$insert_location')\" title='Italic'><img src=".$config_http_script_dir."/skins/images/tags/i.gif border=0 align=middle></a>
      <a href=\"javascript:insertext('<u>','</u>','$insert_location')\" title='Underline'><img src=".$config_http_script_dir."/skins/images/tags/u.gif border=0 align=middle></a>
      <a href=\"javascript:insertext('<s>','</s>','$insert_location')\" title='Linethrough'><img src=".$config_http_script_dir."/skins/images/tags/s.gif border=0 align=middle></a>
      <a href=\"javascript:insertext('<p class=&quot;ptp&quot;>','</p>','$insert_location')\" title='Paragraph'><img src=".$config_http_script_dir."/skins/images/tags/p.gif border=0 align=middle></a>
      <a href=\"javascript:insertext('<img src=&quot;&quot; class=&quot;&quot; />','','$insert_location')\" title='Paragraph'><img src=".$config_http_script_dir."/skins/images/tags/img.gif border=0 align=middle></a>
      </div>";

return $output;
}

Fri Sep 14, 2007 10:53 am View user's profile Send private message
eberswine



Joined: 26 Apr 2007
Posts: 123

Post Reply with quote
Ok, here is a quick question along the same lines.
I am trying my best to revamp the AddNews section with new "codes" that suit ME!

Here is the problem:
I would want to add a button to the addNews section that has this code applied when pressed:
Code:
Men<!--firstpage-->
<pre>

</pre>
<!--nextpage-->Women<!--nexttitle-->
<pre>

</pre>


As you can see, it is to add pages. I have running results to post ALL the TIME. And I have been just opening up a notepad copy of the code and doing some hard copy and pasting.
I can get the code in the addnews when pressed, that isn't the problem, the problem is trying to get the <br /> BREAKS or RETURNS in the code. Right now the code is applied like so:
Code:
Men<!--firstpage--><pre></pre><!--nextpage-->Women<!--nexttitle--><pre></pre>


I tried "/n" and <br /> but coming up with errors..

THANKS.
Sat Apr 19, 2008 9:01 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2668
Location: Germany

Post Reply with quote
Well, the following example works:
Code:
<textarea id="story"></textarea>

<input type="button" onclick="document.getElementById('story').value = 'Men<!--firstpage-->\n<pre>\n\n</pre>\n<!--nextpage-->Women<!--nexttitle-->\n<pre>\n\n</pre>'" value="Insert" />


Make sure that the text you want to insert is on one line otherwise you get errors.
Tue Apr 22, 2008 6:12 pm View user's profile Send private message
eberswine



Joined: 26 Apr 2007
Posts: 123

Post Reply with quote
FI-DD wrote:
Well, the following example works:
Code:
<textarea id="story"></textarea>

<input type="button" onclick="document.getElementById('story').value = 'Men<!--firstpage-->\n<pre>\n\n</pre>\n<!--nextpage-->Women<!--nexttitle-->\n<pre>\n\n</pre>'" value="Insert" />


Make sure that the text you want to insert is on one line otherwise you get errors.


FI-DD,

I tried this and it didn't work?

Code:
<a href=\"javascript:insertext('Men<!--firstpage-->\n<pre>\n\n</pre>\n<!--nextpage-->Women<!--nexttitle-->\n<pre>\n\n</pre>','</pre>','$insert_location')\" title='Results'><img src=".$config_http_script_dir."/skins/images/tags/page.gif border=0 align=middle></a>

Tue May 06, 2008 8:41 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2668
Location: Germany

Post Reply with quote
Code:
<a href=\"javascript:insertext('Men\<!--firstpage-->\\n<pre>\\n\\n</pre>\\n\<!--nextpage-->Women\<!--nexttitle-->\\n<pre>\\n\\n</pre>','</pre>','$insert_location')\" title='Results'><img src=".$config_http_script_dir."/skins/images/tags/page.gif border=0 align=middle></a>

Thu May 08, 2008 5:18 pm View user's profile Send private message
eberswine



Joined: 26 Apr 2007
Posts: 123

Post Reply with quote
SICK.

works great.
thanks. FIDD

Here is a snapshot of my early customization in the add news mod.




Last edited by eberswine on Sat May 10, 2008 10:55 pm; edited 4 times in total
Thu May 08, 2008 9:47 pm View user's profile Send private message
scottdallas



Joined: 04 May 2006
Posts: 1802
Location: US

Post Reply with quote
your snapshot no load Sad i wanted to see what you did!

_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Sat May 10, 2008 5:45 pm View user's profile Send private message Visit poster's website AIM Address
eberswine



Joined: 26 Apr 2007
Posts: 123

Post Reply with quote
updated.

adding certain "codes" "snippets" that I use a lot.. also, it makes it easier when I have someone else update or make a website for them using CNR... just add another button.

lol

Laughing Laughing Laughing Laughing Laughing Laughing
Sat May 10, 2008 10:57 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    Forum Index » Help All times are GMT + 1 Hour
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.