Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Thema gestartet von: L'AltroWeb in März 20, 2009, 12:11:31 NACHMITTAGS

Titel: GuestBar Warning!
Beitrag von: L'AltroWeb in März 20, 2009, 12:11:31 NACHMITTAGS
Hi! I've maked a guestbar warning in my site with this code:
open index.template.php
find:
echo '
<div id="mainarea">';
}

replace with:
echo '
<div id="mainarea">';
// Start GuestBar
if ($context['user']['is_guest'])
echo '
<div id="guestbar">
', $txt['guestbartxt'], '
</div>';
// End GuestBar
}

open index.english.php
add:
// Guest Bar
$txt['guestbartxt'] = '<strong>Warning:</strong>
You are not registered yet. <a href="' . $scripturl . '?action=register">&quot;Register&quot;</a>
or <a href="' . $scripturl . '?action=login">&quot;Login&quot;</a>
to access all functions and delete this warning.';


open index.italian.php
add:
// Guest Bar
$txt['guestbartxt'] = '<strong>Avviso:</strong>
Non sei registrato al sito. <a href="' . $scripturl . '?action=register">&quot;Registrati&quot;</a>
o fai il <a href="' . $scripturl . '?action=login">&quot;Login&quot;</a>
per accedere a tutte le funzioni ed eliminare questo avviso.';


open style.css
add:
/* Guest Bar Start */
#guestbar {
margin-top: 10px;
padding: 5px;
background: white;
color: #000;
border: #000 1px dotted;
font-size: x-small;
font-family: verdana, sans-serif;
}
#guestbar a {
color: #00f;
text-decoration: none;
font-weight: bold;
}
/* Guest Bar End */

U can see a demo here: http://darkwolf.altervista.org/ (http://darkwolf.altervista.org/)  ;)
-
Or here (english): http://darkwolf.altervista.org/forum/index.php?language=english (http://darkwolf.altervista.org/forum/index.php?language=english)
Titel: Re: GuestBar Warning!
Beitrag von: Marcus Forsberg in März 20, 2009, 12:15:10 NACHMITTAGS
Would you like this moved to Tips and Tricks (http://www.simplemachines.org/community/index.php?board=72.0)?
Titel: Re: GuestBar Warning!
Beitrag von: L'AltroWeb in März 20, 2009, 12:18:17 NACHMITTAGS
Zitat von: Nas in März 20, 2009, 12:15:10 NACHMITTAGS
Would you like this moved to Tips and Tricks (http://www.simplemachines.org/community/index.php?board=72.0)?
Yes please :)
And sorry for my error.
Titel: Re: GuestBar Warning!
Beitrag von: Marcus Forsberg in März 20, 2009, 12:28:11 NACHMITTAGS
Moved and added to the Tips and Tricks (index) (http://www.simplemachines.org/community/index.php?topic=15899.0). :)
Titel: Re: GuestBar Warning!
Beitrag von: L'AltroWeb in März 20, 2009, 12:31:23 NACHMITTAGS
Thank'u very much Nas :)
-
Edit: i've inserted font-weight: bold; in css to remove more strong from code ;)
Titel: Re: GuestBar Warning!
Beitrag von: Hell Raiser in März 22, 2009, 10:19:55 VORMITTAG
CAN Anyone show me the proof whether work or not
Titel: Re: GuestBar Warning!
Beitrag von: bullbreedluverz in März 22, 2009, 10:40:25 VORMITTAG
Zitat von: Techyden in März 22, 2009, 10:19:55 VORMITTAG
CAN Anyone show me the proof whether work or not

you could try clicking the demo link in the first post  ;D
Titel: Re: GuestBar Warning!
Beitrag von: agbattery in März 23, 2009, 03:57:38 NACHMITTAGS
Nice coding.  Will be put to use.
Titel: Re: GuestBar Warning!
Beitrag von: L'AltroWeb in März 25, 2009, 10:13:51 VORMITTAG
Zitat von: agbattery in März 23, 2009, 03:57:38 NACHMITTAGS
Nice coding.  Will be put to use.
Thanks :)
Titel: Re: GuestBar Warning!
Beitrag von: JBlaze in April 24, 2009, 08:02:53 NACHMITTAGS
Dark-Wolf, would you like this to be made into a mod?
Titel: Re: GuestBar Warning!
Beitrag von: L'AltroWeb in April 24, 2009, 11:02:25 NACHMITTAGS
I think isn't necessary but if you want/can for me is ok :)
Titel: Re: GuestBar Warning!
Beitrag von: JBlaze in Mai 12, 2009, 01:09:21 VORMITTAG
I forgot, this is already a mod.

http://custom.simplemachines.org/mods/index.php?mod=1607