Replacement Tags Helper

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
Goran
Posts: 81
Joined: Thu 27. Nov 2003, 11:43
Location: Zagreb, Croatia
Contact:

Replacement Tags Helper

Post 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.
Last edited by Goran on Fri 29. Dec 2006, 13:44, edited 10 times in total.
brans

Post 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...
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Post by cyrano »

Hi Goran, nice tool.

Next would be to click on the RT and copy them in the editing article :-)
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
User avatar
isac
Posts: 410
Joined: Tue 18. Nov 2003, 13:13
Location: Portugal
Contact:

Post by isac »

Thank you Goran!!!!!
Very well done :mrgreen:

Isac
sigaq
Posts: 8
Joined: Tue 21. Sep 2004, 08:47
Location: Salisbury, UK

Post 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
Goran
Posts: 81
Joined: Thu 27. Nov 2003, 11:43
Location: Zagreb, Croatia
Contact:

Post 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 .
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Post 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.
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
Goran
Posts: 81
Joined: Thu 27. Nov 2003, 11:43
Location: Zagreb, Croatia
Contact:

Post 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.
sigaq
Posts: 8
Joined: Tue 21. Sep 2004, 08:47
Location: Salisbury, UK

Post 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
Goran
Posts: 81
Joined: Thu 27. Nov 2003, 11:43
Location: Zagreb, Croatia
Contact:

Post by Goran »

Sigag, good suggestion but this is out of my knowledge...maybe someone else can create database driven "Replacement Tags Helper"..
api-devlab
Posts: 1
Joined: Mon 8. Nov 2004, 22:34
Location: Manchester, England
Contact:

replacement tags listing to the docu.fhss.de page

Post 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
Jimmy_Jazz
Posts: 23
Joined: Thu 28. Oct 2004, 13:04
Location: London

Post 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
Jimmy_Jazz
Posts: 23
Joined: Thu 28. Oct 2004, 13:04
Location: London

Post by Jimmy_Jazz »

Ok link works fine now. Not sure why didnt work before.

Great mod! Very useful.
Neelix
Posts: 80
Joined: Wed 29. Sep 2004, 12:06
Location: España

Post 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:
Last edited by Neelix on Wed 17. Nov 2004, 18:15, edited 1 time in total.
Erfahrung ist das, was man besitzt, kurz nach dem es gebraucht wurde.
Warning: I have no foggiest idea of English/German, but I do
-ha{p}{p}y day/night/dia/noche-
Goran
Posts: 81
Joined: Thu 27. Nov 2003, 11:43
Location: Zagreb, Croatia
Contact:

Post by Goran »

Neelix, great job man :lol: ....I uploaded the new version with your modification included.
Post Reply