Author Topic: [Mod] By clicking Buttons, Popup-message to unregistered Users  (Read 8714 times)

0 Members and 1 Guest are viewing this topic.

Rembrandt

  • Guest
[Mod] By clicking Buttons, Popup-message to unregistered Users
« on: February 26, 2011, 06:11:26 PM »
Hi!

By clicking "lightbox", "e-card", "download", or "download-zip" button popup-message to unregistered users.

The idea comes from here: http://www.4homepages.de/forum/index.php?topic=29157.0

Here can you see the effect Demo

1.) create a new file call it "please_reg.html" and store in your templates folder.
Code: [Select]
{header}
<div align="center"><b>{lang_please} <a href="{url_register}" onclick="void(window.open(this.href, '', ''));self.close(); return false;">{lang_plr_register}</a> {lang_plr_or} <a href="{url_login}" onclick="void(window.open(this.href, '', ''));self.close(); return false;">{lang_login}</a></b></div>
{footer}

2.) search in includes/functions.php:

if ($user_info['user_level'] != GUEST) {

insert above:

$please_reg 
"<a href=\"".ROOT_PATH."index.php?template=please_reg\" onclick=\"void(window.open(this.href,this.target,'width=300px,height=150px,top=200px,left=500px,resizable=0,menubar=no,locationbar=no,scrollbars=auto'));return false;\">";

search:

$lightbox_button 
"<img src=\"".get_gallery_image("lightbox_off.gif")."\" border=\"0\" alt=\"\" />";

replace:

$lightbox_button 
"".$please_reg."<img src=\"".get_gallery_image("lightbox_off.gif")."\" border=\"0\" alt=\"\" /></a>";

search:

$download_button 
"<img src=\"".get_gallery_image("download_off.gif")."\" border=\"0\" alt=\"\" />";
$download_zip_button = (function_exists("gzcompress") && function_exists("crc32")) ? "<img src=\"".get_gallery_image("download_zip_off.gif")."\" border=\"0\" alt=\"\" />" "";

replace:

$download_button 
"".$please_reg."<img src=\"".get_gallery_image("download_off.gif")."\" border=\"0\" alt=\"\" /></a>";    
$download_zip_button = (function_exists("gzcompress") && function_exists("crc32")) ? "".$please_reg."<img src=\"".get_gallery_image("download_zip_off.gif")."\" border=\"0\" alt=\"\" /></a>" "";

search:

$postcard_button 
"<img src=\"".get_gallery_image("postcard_off.gif")."\" border=\"0\" alt=\"\" />";

replace:

$postcard_button 
"".$please_reg."<img src=\"".get_gallery_image("postcard_off.gif")."\" border=\"0\" alt=\"\" /></a>";

search:

"download_zip_button" => $download_zip_button,

insert below:

"lang_please" => $lang['please'],
"lang_plr_or" => $lang['plr_or'],
"lang_plr_register" => $lang['plr_register'],


3.) search in lang/yourLang/main.php:

//--- Misc --------------------------------------------
//-----------------------------------------------------

insert below:
(deutsch)

$lang
['please'] = "Bitte";
$lang['plr_or'] = "oder";
$lang['plr_register'] = "Registrieren";

(english)

$lang
['please'] = "Please";
$lang['plr_or'] = "or";
$lang['plr_register'] = "Register";


mfg Andi
« Last Edit: June 14, 2011, 04:04:32 PM by Rembrandt »

Offline alex83we

  • Pre-Newbie
  • Posts: 3
    • View Profile
Re: [Mod] By clicking Buttons, Popup-message to unregistered Users
« Reply #1 on: June 14, 2011, 12:42:16 PM »
bei punkt 3 fehlen zeichen bitte in der Mod ersetzten richtig muss es so sein


$lang
['please'] = "Bitte";
$lang['plr_or'] = "oder";
$lang['plr_register'] = "Registrieren";


aber trotzdem danke für die tolle erweiterung und deine Arbeit

Rembrandt

  • Guest
Re: [Mod] By clicking Buttons, Popup-message to unregistered Users
« Reply #2 on: June 14, 2011, 04:05:09 PM »
Danke!

mfg Andi

Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.287
    • View Profile
    • Discover the New World of Kindersurprise
Re: [Mod] By clicking Buttons, Popup-message to unregistered Users
« Reply #3 on: June 14, 2011, 06:09:09 PM »
kannte ich noch gar nicht  :oops:
Klasse gemacht
Danke Harald




Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.287
    • View Profile
    • Discover the New World of Kindersurprise
Re: [Mod] By clicking Buttons, Popup-message to unregistered Users
« Reply #4 on: June 16, 2011, 11:01:41 PM »
seit ihr sicher, das dies nicht in die page_header.php gehört  :?:

"lang_please" => $lang['please'],
"lang_plr_or" => $lang['plr_or'],
"lang_plr_register" => $lang['plr_register'],


denn bei mir wurde der Text erst angezeigt, als ich dieses da eingefügt hatte, in der functions.php hatte es keinen Erfolg, habe es da auch raus genommen, und klappt

LG
Danke Harald




Rembrandt

  • Guest
Re: [Mod] By clicking Buttons, Popup-message to unregistered Users
« Reply #5 on: June 17, 2011, 05:21:17 AM »
ich habe noch mal nachgesehen, ich habe es in der functions.php.
aber ich denke mal das es egal ist wo die "lang" registriert sind, die page_header ist sicher nicht verkehrt. :)

mfg Andi