Page 1 of 3

Replacement Tags Helper

Posted: Thu 30. Sep 2004, 17:08
by Goran
Very simple and helpful hack... display Replacement Tags in admin area (in left column). You can copy (on click) Replacement Tag value into the clipboard (meaning you just CTRL-V to paste).

UPDATED! (Dec. 28, 2006)
Updated by flip-flop with new replacement tags.

UPDATED! (Aug. 11, 2006)
Script is upgraded again, I added the call to the tooltips with short instruction for each tag. Just move your mouse over tag name and tooltip appears.
Also, reduced script size 11kb.

UPDATED! (Sep. 27, 2005)
Added modification by Rick(rtilghman)..now Replacement Tags Helper is displayed only in the admin section where admin work on the site or in the article sections.
Added some new tags and reduced script size from 16 to 10 kb.

UPDATED! (Nov. 17, 2004)
Added modification by Neelix..now GT MOD section of Replacement Tags Helper could display the actual styles that admin has set up.

UPDATED! (Oct. 27, 2004)
Added Replacement Tags for Company Mod.

--------------------------------------------------------


Screenshots:

Image



Download:

Replacement_Tags_Helper.zip

Read the install.txt file to install.

Posted: Thu 30. Sep 2004, 17:59
by brans
ouhm maybe we could enhance this script by simply linking directly from the replacement tags listing to the docu.fhss.de page ?!? explanation of the concerned tag ?

I think this was very nice...

Posted: Thu 30. Sep 2004, 19:14
by cyrano
Hi Goran, nice tool.

Next would be to click on the RT and copy them in the editing article :-)

Posted: Thu 30. Sep 2004, 19:36
by isac
Thank you Goran!!!!!
Very well done :mrgreen:

Isac

Posted: Thu 30. Sep 2004, 23:15
by sigaq
Thanks Goran - just one little change needed to install.txt for PHP newbies

should

[ ADD BETWEEN "<?" AND "</td>" ]

be

[ ADD BETWEEN "?>" AND "</td>" ]

Thanks again,
JP

Posted: Fri 1. Oct 2004, 03:31
by Goran
Thank you guys!

sigaq, thanks....fixed.

brans, good suggestion, but i don't know how. :?:

cyrano, just uploaded new version with possibility to click on the Replacement Tags Button and copy them in the editing area .

Posted: Fri 1. Oct 2004, 10:06
by cyrano
Hi Goran,

that's great.

I uploaded the new version, can click, but nothing more happens... using IE.

How to use it exactly?

I will play a bit more...

Thanks for this nice little thing.

Posted: Fri 1. Oct 2004, 13:28
by Goran
Ok, new version is out, removed possibility to click on the Replacement Tags Button and copy code in the editing area (works only with html textarea) .
-------------------------------------------------

Now you can copy (on click) Replacement Tag value into the clipboard (meaning you just CTRL-V to paste).

1. Click on the Replacement Tag (it should select and copy the code to the clipboard),
2. Paste (CTRL-V) the value into the textarea.

What's so cool about this? It saves the user from having to highlight and manually select the input, which saves time, saves keystrokes, mouseclicks and movements, and reduces the chance of an incomplete select.

NOTE:
Works in IE5+, for Firefox, Opera or Mozilla user Replacement Tag is only highlighted on click.

Posted: Fri 1. Oct 2004, 17:51
by sigaq
Great mod Goran!

Another suggestion for you - perhaps the {GT:style} section of your mod could display the actual styles that admin has set up ?

All the best,
JP

Posted: Wed 6. Oct 2004, 01:59
by Goran
Sigag, good suggestion but this is out of my knowledge...maybe someone else can create database driven "Replacement Tags Helper"..

replacement tags listing to the docu.fhss.de page

Posted: Sun 14. Nov 2004, 01:46
by api-devlab
brans wrote:maybe we could enhance this script by simply linking directly from the replacement tags listing to the docu.fhss.de page ?!?
sigaq wrote:perhaps the {GT:style} section of your mod could display the actual styles that admin has set up ?
Only just found this...really great idea, I'll take a look at this and see what I can do with it.

The documentation at http://www.phpwcms-docu.de/index.php?english_version is :D so this would be a useful addition for all phpwcms users....

api-devlab

Posted: Mon 15. Nov 2004, 15:28
by Jimmy_Jazz
Hi

im interested in this mod but the link is currently inactive- cant download. Could you put it back online? I was thinking about something like this for phpwcms just the other day!

Cheers

Posted: Mon 15. Nov 2004, 16:02
by Jimmy_Jazz
Ok link works fine now. Not sure why didnt work before.

Great mod! Very useful.

Posted: Wed 17. Nov 2004, 17:52
by Neelix
sigaq wrote: Another suggestion for you - perhaps the {GT:style} section of your mod could display the actual styles that admin has set up ?
:wink: OK - here is it:

1'st: download the mod by Goran!

---[open]---
tags.php
---[find]---
<input class="input_tags" accesskey="x" style="width:165; height:18px;" onfocus="if(window.fExample) window.fExample(this)"
onclick="if(window.fExample) window.fExample(this);" value="{GT:style} &raquo; Hello!{/GT}">
---[replace]---

Code: Select all

<?php 

  function getGTStyles()
   {
      global $db;
		//the stylnames are stored in the table: [phpwcms_fonts_styles] as style_name
		$sQuery = 'SELECT style_name FROM '.DB_PREPEND.'phpwcms_fonts_styles ORDER BY style_name';

      if (isset($db) && $db)
          $hResult = mysql_query($sQuery, $db);
      else
          $hResult = mysql_query($sQuery);

		$ret=array();

		while ($row=mysql_fetch_object($hResult))
		{
   	   $ret[]=$row->style_name;;
		}

               //update this
		if (!$ret)
		{
			$ret[]='<stylename>'; //if no style is defined the result is the generic name! 
		}

      return $ret;
   }

	$sStyles=getGTStyles();
	for ($i=0;$i<count($sStyles);$i++)
	{
    echo '<input class="input_tags" accesskey="x" style="width:165; height:18px;" onfocus="if(window.fExample) window.fExample(this)"';
    echo 'onclick="if(window.fExample) window.fExample(this);" value="{GT:'.$sStyles[$i].'}Example!{/GT}">';
	}

 ?>

cry if something goes wrong or unclear (not so loud please) :wink:

Posted: Wed 17. Nov 2004, 18:05
by Goran
Neelix, great job man :lol: ....I uploaded the new version with your modification included.