The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

I Want To Edit The Search Bar

5 posters

Go down

In progress I Want To Edit The Search Bar

Post by Mr DarkHaxers2 March 10th 2012, 4:45 am

Ok I want to edit the search bar but idk where it is in the templates so here's a picture what im talking about:

Modify the search bar - I Want To Edit The Search Bar Search10

Please help me find the search bar to this in the templates so i could edit and code it for my self
Mr DarkHaxers2
Mr DarkHaxers2
Forumember

Male Posts : 409
Reputation : -17
Language : English
Location : Modesto,Cali

Back to top Go down

In progress Re: I Want To Edit The Search Bar

Post by ankillien March 10th 2012, 8:10 am

Hi,

The search popup code is not there in the templates. It is added via a javascript. If you want to change it, you can use javascript itself. Access the element using getElementById('search_menu').
ankillien
ankillien
Energetic

Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL

Back to top Go down

In progress Re: I Want To Edit The Search Bar

Post by Mr DarkHaxers2 March 10th 2012, 6:32 pm

ok but i do't get the java script wut you saying
Mr DarkHaxers2
Mr DarkHaxers2
Forumember

Male Posts : 409
Reputation : -17
Language : English
Location : Modesto,Cali

Back to top Go down

In progress Re: I Want To Edit The Search Bar

Post by ankillien March 11th 2012, 3:09 am

For that purpose, you must know javascript. Alternatively, you can achieve it with jQuery. You should know either of them.
ankillien
ankillien
Energetic

Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL

Back to top Go down

In progress Re: I Want To Edit The Search Bar

Post by Mr DarkHaxers2 March 11th 2012, 5:34 am

i don't Java script but i know html and css
Mr DarkHaxers2
Mr DarkHaxers2
Forumember

Male Posts : 409
Reputation : -17
Language : English
Location : Modesto,Cali

Back to top Go down

In progress Re: I Want To Edit The Search Bar

Post by ankillien March 11th 2012, 12:32 pm

You can access the popup search with javascript only. You should know at least the basics for that.
ankillien
ankillien
Energetic

Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL

Back to top Go down

In progress Re: I Want To Edit The Search Bar

Post by Niko March 13th 2012, 6:36 pm

Hi!

If you want to edit the layout you can do it with CSS...
But if you want to add functions, ecc. you need a Java code Mr. Green

Answer me and I'll help you...
Friendly,
Niko
Niko
Helper
Helper

Male Posts : 3100
Reputation : 244
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

Back to top Go down

In progress Re: I Want To Edit The Search Bar

Post by Mr DarkHaxers2 March 13th 2012, 7:14 pm

i want to edit the lay out in side of the search box like search Jquery i want to change that to a main head and change the name to Search
Mr DarkHaxers2
Mr DarkHaxers2
Forumember

Male Posts : 409
Reputation : -17
Language : English
Location : Modesto,Cali

Back to top Go down

In progress Re: I Want To Edit The Search Bar

Post by Zerotheheroe March 14th 2012, 3:20 pm

Hello, please ignore all of the other responses because they have nothing to do with what you're asking.

Do to this, open your Administration Panel.

Display < Templates < General

If you're wanting to change the search bar, then just find the proper body in that section and change it to your liking.
Zerotheheroe
Zerotheheroe
Forumember

Posts : 333
Reputation : 8
Language : English

http://www.clancaos.net

Back to top Go down

In progress Re: I Want To Edit The Search Bar

Post by enlil March 15th 2012, 2:39 pm

Hi,


There is no template of quick search bar like ankilien said.

It's added by javascript, the base function is :

Code:
function insert_search_menu_new(session_id) {
  session_input = session_id ? '<input type="hidden" name="sid" value="' + session_id + '" />' : "";
  session_id = session_id ? "?sid=" + session_id : "";
  url_search = window.url_search || "/search.forum";
  document.write('<div class="overview row3" id="search_menu" style="display:none;position:absolute;width:350px;z-index:10000"><form action="' + url_search + '" method="get"><input type="hidden" name="mode" value="searchbox" /><p class="title-overview row2">Search Query</p><p class="center-overview"><input type="text" class="inputbox medium" name="search_keywords" />' + session_input + '<input type="submit" class="button1" value="Go" /><br />Display results as : <label for="rposts"><input id="rposts" type="radio" name="show_results" value="posts" /> Posts</label> <label for="rtopics"><input id="rtopics" type="radio" name="show_results" value="topics" checked="checked" /> Topics</label></p><hr class="dashed" /><p class="center-overview"><a href="' +
  url_search + session_id + '" rel="nofollow" title="Advanced Search"><img src="http://2img.net/i/fa/empty.gif" width="12" height="13" alt="Advanced Search" /> Advanced Search</a></p>' + session_input + "</form></div>")
}
;
But you can create a new javascript file and redefine the function with what you want, for example :

Code:
function insert_search_menu_new(session_id) {
  session_input = session_id ? '<input type="hidden" name="sid" value="' + session_id + '" />' : "";
  session_id = session_id ? "?sid=" + session_id : "";
  url_search = window.url_search || "/search.forum";
  document.write('<div class="overview row3" id="search_menu" style="display:none;position:absolute;width:350px;z-index:10000"><form action="' + url_search + '" method="get"><input type="hidden" name="mode" value="searchbox" /><p class="title-overview row2">What you search: </p><p class="center-overview"><input type="text" class="inputbox medium" name="search_keywords" />' + session_input + '<input type="submit" class="button1" value="Go" /><br />Result as : <label for="rposts"><input id="rposts" type="radio" name="show_results" value="posts" /> messages</label> <label for="rtopics"><input id="rtopics" type="radio" name="show_results" value="topics" checked="checked" /> topics</label></p><hr class="dashed" /><p class="center-overview"><a href="' +
  url_search + session_id + '" rel="nofollow" title="Advanced Search"><img src="http://2img.net/i/fa/empty.gif" width="12" height="13" alt="Advanced Search" /> Advanced Search</a></p>' + session_input + "</form></div>")
}
;
You don't need to know a lot of javascript :

- "words" = a text string
- 'words' = the second way to be a text string
- "an "+'orange' = 2 strings concatenated

since ' or " are the delimiters of start or end of the string, if you want to use it in, you need to use a \ before them, here is a little script to input content and get as as a javascript string :
http://www.maonyn.com/h22-test-to-js-string-en

if you want to test code to see where you can have done an error, this tools is a good way :
http://closure-compiler.appspot.com/home

it's basically for optimizing length of code, but if there is a syntax error, it will tell you there is error and where they are.
avatar
enlil
New Member

Posts : 16
Reputation : 5
Language : c

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum