Info-PopUp Plugin

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
Post Reply
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Info-PopUp Plugin

Post by pico »

/* ############################################################################
*
* Name : infopopup
* Description : Infopopup Plug-In for FCKeditor and Replacement Tag for phpWCMS
* Part of : phpwcms-XT
* Author : Horst-D. Kroeller
* Version : 1.0.0
* Date : 09.07.2006 12:39
* Copyright : 2006 by Author
*
#############################################################################*/

Sample -> here

Installation:
download the ->Zip
extract the Zip-Archive and do the following Steps
---------------------------------------------------------------------------------
Step 1:
---------------------------------------------------------------------------------
copy the Folders to the Base-Folder of your phpwcms installation

---------------------------------------------------------------------------------
Step 2:
---------------------------------------------------------------------------------
open ../include/inc_ext/FCKeditor2/fckconfig.js

search ------------------------

Code: Select all

FCKConfig.PluginsPath = FCKConfig.BasePath + 'plugins/' ;
add after this Line -----------

Code: Select all

FCKConfig.Plugins.Add( 'InfoPopUp','en' );
search ------------------------

Code: Select all

FCKConfig.ToolbarSets["phpwcms"]
or

Code: Select all

FCKConfig.ToolbarSets["default"]
(this depends from the phpwcms Version you use)

add 'InfoPopUp' somewhere in the Toolbarstructure - please Notice
don't forget to keep the Syntax of the Toolbar

Sample before

Code: Select all

['Link','Unlink','Anchor']
and after adding

Code: Select all

['Link','Unlink','Anchor','InfoPopUp']
---------------------------------------------------------------------------------
Step 3:
---------------------------------------------------------------------------------
open ../include/inc_front/front.func.inc.php

search -------------------

Code: Select all

function html_parser($string) {
goto the end of the List like:

Code: Select all

	// this tags out a Mailaddress with an predifined subject (by Florian, 21-11-2003)
	$search[24]     = '/\[MAILSUB (.*?) (.*?)\](.*?)\[\/MAILSUB\]/i';
	$replace[24]    = '<a href="mailto:$1?subject=$2">$3</a>';

	// added simple [br] -> <br />
	$search[25]     = '/\[br\]/i';
	$replace[25]    = '<br />';

	// create "make bookmark" javascript code
	$search[26]     = '/\[BOOKMARK\s{0,}(.*)\](.*?)\[\/BOOKMARK\]/i';
	$replace[26]    = '<a href="#" onClick="BookMark_Page();return false;" title="$1">$2</a>';
and add

Code: Select all

	// Infopopup
  $search[xx]     = '/\[POPUP (.*?)\](.*?)\[\/POPUP\]/i';
  $replace[xx]    = "<a onmouseover=\"show_infopopup('$1')\" onmouseout=\"hide_infopopup()\" class=\"infopopup_highlight\"> $2</a>";
add one to the last Number in Brakets - here [26] so it reads when finish

Code: Select all

	// this tags out a Mailaddress with an predifined subject (by Florian, 21-11-2003)
	$search[24]     = '/\[MAILSUB (.*?) (.*?)\](.*?)\[\/MAILSUB\]/i';
	$replace[24]    = '<a href="mailto:$1?subject=$2">$3</a>';

	// added simple [br] -> <br />
	$search[25]     = '/\[br\]/i';
	$replace[25]    = '<br />';

	// create "make bookmark" javascript code
	$search[26]     = '/\[BOOKMARK\s{0,}(.*)\](.*?)\[\/BOOKMARK\]/i';
	$replace[26]    = '<a href="#" onClick="BookMark_Page();return false;" title="$1">$2</a>';

	// Infopopup
  $search[27]     = '/\[POPUP (.*?)\](.*?)\[\/POPUP\]/i';
  $replace[27]    = "<a onmouseover=\"show_infopopup('$1')\" onmouseout=\"hide_infopopup()\" class=\"infopopup_highlight\"> $2</a>";

	$string = preg_replace($search, $replace, $string);
	$string = str_replace('\'', ''', $string);
	$string = str_replace('&quot;', '"', $string);
	return $string;
}
---------------------------------------------------------------------------------
Step 4
---------------------------------------------------------------------------------
copy this or the Content of frontend.css to you frontend.css

Code: Select all

#infopopup_box{
 position: absolute;
 left: -300px;
 width: 150px;
 border: 1px solid black;
 padding: 2px;
 background-color: lightyellow;
 visibility: hidden;
 z-index: 100;
 /*Remove below line to remove shadow. Below line should always appear last within this CSS*/
 filter: progid:DXImageTransform.Microsoft.Shadow(color=gray,direction=135);
 }

#infopopup_pointer{
 position:absolute;
 left: -300px;
 z-index: 101;
 visibility: hidden;
 }

.infopopup_highlight{
 background-color: #FFF36F;
 border: 1px dotted green;
 }
---------------------------------------------------------------------------------
Step 5
---------------------------------------------------------------------------------
add the following Line into your Template/HTML-Head
<script type="text/javascript"

Code: Select all

src="/phpwcms_template/inc_js/infopopup.js"></script>
or to make it permanent add this Line to index.php
search ----------

Code: Select all

	$content['page_start'] .= '<script src="'.TEMPLATE_PATH.'inc_js/frontend.js" type="text/javascript"></script>'."\n";
add after --------------

Code: Select all

$content['page_start'] .= '<script src="'.TEMPLATE_PATH.'inc_js/infopopups.js" type="text/javascript"></script>'."\n";
---------------------------------------------------------------------------------
Usage:
---------------------------------------------------------------------------------
in HTML you can use this Notation:

this is how

Code: Select all

[POPUP Text for the Popup] it works [/POPUP]
---------------------------------------------------------------------------------
in FCKeditor you have a new Button in Toolbar.
Write your Text, mark the Word or Aerea for the Popup and click on the Button,
a new Window opens where you can insert the Text for the Popup..

in Popup-Text are <b>text</b> <i>text</i> <u>text</u> and <br> allowed

have Fun Horst
Last edited by pico on Fri 21. Jul 2006, 10:24, edited 3 times in total.
Lieber Gott gib mir Geduld - ABER BEEIL DICH
Horst - find me at Musiker-Board
User avatar
Kosse
Posts: 1066
Joined: Thu 9. Sep 2004, 12:08
Location: Brussels, Belgium
Contact:

Post by Kosse »

This is very cool, thanks pico.
Mucho nice!!!!

and... congrats to the 82 ;)
Cheers
User avatar
juergen
Moderator
Posts: 4556
Joined: Mon 10. Jan 2005, 18:10
Location: Weinheim
Contact:

Post by juergen »

Hi

looks nice
seams helpfull

need it :D

Jürgen
selbaer
Posts: 93
Joined: Sun 22. Jan 2006, 02:19
Location: Florida West Coast

Post by selbaer »

works perfect, thanks pico
fopulu
Posts: 359
Joined: Tue 2. May 2006, 14:19
Location: Rhein-Main

Post by fopulu »

can we see a demo, please? :wink:
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post by pico »

can you read please the first Posting ;)
Sample -> here
Lieber Gott gib mir Geduld - ABER BEEIL DICH
Horst - find me at Musiker-Board
User avatar
juergen
Moderator
Posts: 4556
Joined: Mon 10. Jan 2005, 18:10
Location: Weinheim
Contact:

Post by juergen »

Hi pico,

maybe some small problem.... in your zip there is a dir named :

phpwcms-templates .. should be without the "s" ?

Jürgen
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post by pico »

ups - will correct it tommorrow
Lieber Gott gib mir Geduld - ABER BEEIL DICH
Horst - find me at Musiker-Board
Post Reply