We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Add Search Next to Time in Footer
Topic Started: Jun 19 2012, 03:11 PM (1,008 Views)
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
Code Name: Add Search Next to Time in Footer

What the code does: It adds a board search to the bottom of the site next to the Time

How to use the code: Copy/Paste and then use!

How to install the code:

Board Wrapper > Below The Board
Copy/Paste:

Code:
 
<script type="text/javascript">
//<![CDATA[
// Add Search Next to Time in Footer
// by Skyon Archer
var currentTime = new Date()
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
var year = currentTime.getFullYear()
$("#foot_datetime").append(' <span style="border-left : 1px solid #e7e7e7;"> </span> <a href="'+main_url+'search/" target="_blank" title="Search"><img src="http://img19.imageshack.us/img19/9978/searchm.png" alt="Search" width="24" alt="search" /></a> <form action="'+main_url+'search/" method="get"><input type="hidden" name="c" value="1" /><input type="text" name="q" value="Enter your search..." size="40" onfocus="this.value=\'\'" /><input type="radio" name="type" value="post" checked="checked" /> Search Posts <input type="radio" name="type" value="topic" /> Search Topics <input name="sort" value="desc" type="hidden" /><input name="forum[]" value="-1" type="hidden" /><input name="s_m" tabindex="6" value="1" type="hidden" /><input name="s_d" tabindex="7" value="1" type="hidden" /><input name="s_y" tabindex="8" value="2007" type="hidden" /><input name="e_m" tabindex="6" value="'+month+'" type="hidden" /><input name="e_d" tabindex="7" value="'+day+'" type="hidden" /><input name="e_y" tabindex="8" value="'+year+'" type="hidden" /><button type="submit">Search</button></form>');
//]]>
</script>


Example:

Before:
Posted Image

After:
Posted Image

Offline Profile Quote Post Goto Top
 
Deleted User
Deleted User

Is it possible to also remove the Search from the top of the page when adding this code to a forum?
Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
Try adding this:

Code:
 

<script type="text/javascript">
//<![CDATA[
/* remove search from submenu */
$("#submenu a:contains('Search')").remove()
//]]>
</script>
Edited by Skyon Archer, Jun 24 2012, 10:27 AM.
Offline Profile Quote Post Goto Top
 
Deleted User
Deleted User

The second code works as I was hoping. However, the first code (which is quite brilliant) presents something of a problem for me.

It works well for skins with smaller text and such, but for one in particular, it scrunches up all the text and makes the bottom of the forum look yuck. :(

Any way to get this to work with codes that have set board widths like mine (screencap attached)?
Attached to this post:
Attachments: screenie.bmp (999.79 KB)
Quote Post Goto Top
 
Geoffrey
Member Avatar
bury hatchets, keep maps
[ *  *  *  *  * ]
Would it be possible to add this to a new td directly below the #foot_wrap (where the theme chooser, mark topics read and board clock are)? That would likely solve the problem mentioned above, as I imagine that could happen on quite a few themes (especially more narrow ones) and on smaller resolutions (like my own).
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
Try this and see if it produces what you are looking for:

Code:
 
<script type="text/javascript">
//<![CDATA[
// Add Search under Footer
// by Skyon Archer
var currentTime = new Date()
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
var year = currentTime.getFullYear()
$(' <table class="forums" style="display: table;" cellspacing="0"><tr><td><div style="float:right;"> <a href="'+main_url+'search/" target="_blank" title="Search"><img src="http://img19.imageshack.us/img19/9978/searchm.png" alt="Search" width="24" alt="search" /></a> <form action="'+main_url+'search/" method="get"><input type="hidden" name="c" value="1" /><input type="text" name="q" value="Enter your search..." size="40" onfocus="this.value=\'\'" /><input type="radio" name="type" value="post" checked="checked" /> Search Posts <input type="radio" name="type" value="topic" /> Search Topics <input name="sort" value="desc" type="hidden" /><input name="forum[]" value="-1" type="hidden" /><input name="s_m" tabindex="6" value="1" type="hidden" /><input name="s_d" tabindex="7" value="1" type="hidden" /><input name="s_y" tabindex="8" value="2007" type="hidden" /><input name="e_m" tabindex="6" value="'+month+'" type="hidden" /><input name="e_d" tabindex="7" value="'+day+'" type="hidden" /><input name="e_y" tabindex="8" value="'+year+'" type="hidden" /><button type="submit">Search</button></form></div></td></tr></table>').insertAfter('#foot');
//]]>
</script>
Offline Profile Quote Post Goto Top
 
Deleted User
Deleted User

Magnifique!!!!

Works like a charm! <3 So very much appreciated, thanks Skyon! Definitely helps me clear out some of the clutter from all the top links on my forum.
Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · ZetaBoards Codes & Modifications · Next Topic »
Add Reply