News:

Wondering if this will always be free?  See why free is better.

Main Menu

Change the look of some SSI files

Started by DLoney, July 09, 2006, 01:56:26 PM

Previous topic - Next topic

DLoney

Hello everyone.
I was hoping someone could help me out in a few areas...

1st:
-----------------------------------------------------------------------------------
I was wondering how to change the default search button, to an image such as this:



2nd:
-----------------------------------------------------------------------------------
Secondly, I was hoping to modify (or make a variant of) the <?php ssi_welcome(); ?> SSI function.
Right now, when you are not logged in, it shows:

---------------------------------------------------
Welcome, Guest. Please login or register.
Did you miss your activation email?
---------------------------------------------------


I was hoping to change it, so that when you are not log in, it only shows:

---------------------------------------------------
Login | Register
---------------------------------------------------


And then, when logged in, show:

---------------------------------------------------
Welcome _____
---------------------------------------------------


Instead of:

---------------------------------------------------
Hey, _____, you have 0 messages, 0 are new.
---------------------------------------------------



Any ideas?

Ghezus

You also posted on PT:

1st
Button in SSI or on template?






2nd
Make sure you included SSI.php then where you want the welcome stuff to be add:
<?
if ($context['user']['is_guest']) {
            echo '<a href="forum/index.php?action=login">Login</a> | <a href="forum/index.php?action=register">Register</a>';
} else {
            echo 'Welcome ', $context['user']['name'], '!';
}
?>

DLoney

#2
Quote from: Ghezus on July 09, 2006, 05:56:39 PM
Button in SSI or on template?
on SSI... Not the image that is used in the template. I was/am using <?php ssi_quickSearch(); ?>

Quote from: Ghezus on July 09, 2006, 05:56:39 PMMake sure you included SSI.php then where you want the welcome stuff to be added...
Thanks! Works great. Question though, what happens if an members name is too long? Is there a way I can cut it off? EG: if the name is "ABCDEFGHIJKLMNOP", it will only show "ABCDEF..."

Ghezus

Quote from: DLoney on July 09, 2006, 09:50:35 PM
Quote from: Ghezus on July 09, 2006, 05:56:39 PM
Button in SSI or on template?
on SSI... Not the image that is used in the template. I was/am using <?php ssi_quickSearch(); ?>

<form action="', $scripturl, '?action=search2" method="post">
<input type="hidden" name="advanced" value="0" /><input type="text" name="search" size="30" /> <input type="submit" style="border:1px solid #cccccc; font-size: 11px; display: block; text-align: center ; color: #000000; "ame="submit" value="', $txt[182], '" />
</form>

This is untested but it should work....




Quote from: DLoney on July 09, 2006, 09:50:35 PM
Quote from: Ghezus on July 09, 2006, 05:56:39 PMMake sure you included SSI.php then where you want the welcome stuff to be added...
Thanks! Works great. Question though, what happens if an members name is too long? Is there a way I can cut it off? EG: if the name is "ABCDEFGHIJKLMNOP", it will only show "ABCDEF..."
<?
if ($context['user']['is_guest']) {
            echo '<a href="forum/index.php?action=login">Login</a> | <a href="forum/index.php?action=register">Register</a>';
} else {
            echo "Welcome" , echo substr($context['user']['name'], 0, 5), '!';
}
?>

And another unchecked code :P

Advertisement: