Quantcast

Jump to content

» «
Photo

GTAF Search

2 replies to this topic
Mister Kay
  • Mister Kay

    Big Homie

  • Members
  • Joined: 19 Jul 2011

#1

Posted 25 September 2012 - 06:01 PM Edited by deepthroatgta6, 26 September 2012 - 07:04 AM.

I was free and wanted to try my hand at basic html.
I used the GTAF search page source and completely revamped, simplified and manipulated it as per my requirements.
I thought to share it with the members who might find it useful.

Basically, I removed some filters and changed some default selections.
Now all you have to do is save this html file on your PC and bookmark tab it.
I do not have webspace or else I could have uploaded the tool to provide a direct link. here. (temporary)

Click the code if you want to download the html file.

CODE
<html>
<head>
<title>GTAF Search</title>
</head>
<body>

<form action="http://www.gtaforums.com/index.php?act=Search&CODE=01" method="post" name="sForm" id="submit">

<div align="center">

<b>GTAF</b> <input type="submit" value="Search" class="forminput">
<br>
<br>
<table>

<tr>
<td>
<input type="text" maxlength="100" size="40" name="keywords" id="keywords" class="forminput">
</td>
<td>
<label for="keywords">Enter keywords to search</label>
</td>
</tr>

<tr>
<td>
<input type="text" maxlength="100" size="40" name="namesearch" id="MemberName" class="forminput">
</td>
<td>
<label for="membername">By Member Name</label>
</td>
</tr>

<tr>
<td>
</td>
</tr>

<tr>
<td>
<input type="radio" name="search_in" class="radiobutton" id="search_in_posts" value="posts" checked="checked"><label for="search_in_posts">Search entire posts</label>
</td>
<td>
<input type="radio" name="search_in" class="radiobutton" id="search_in_titles" value="titles"><label for="search_in_titles">Search topic titles only</label>
</td>
</tr>

<tr>
<td>
<input type="radio" name="result_type" class="radiobutton" value="posts" id="result_posts" checked="checked"><label for="result_posts">Show results as posts</label>
</td>
<td>
<input type="radio" name="result_type" class="radiobutton" value="topics" id="result_topics"><label for="result_topics">Show results as topics</label>
</td>
</tr>

</table>

</div>

<input type="hidden" name="exactname"value="1">
<input type="hidden" name="forums[]" value="all">
<input type="hidden" name="searchsubs" value="1">
<input type="hidden" name="prune" value="0"">
<input type="hidden" name="prune_type" value="older">
<input type="hidden" name="prune_type" value="newer">
<input type="hidden" name="sort_key" value="last_post">
<input type="hidden" name="sort_order" value="desc">

</form>

</body>

</html>





Also, I made a modified version where I added a javascript and my username in default keywords like this:
CODE
<input type="text" maxlength="100" size="40" name="keywords" id="keywords" class="forminput" value="deept*">


Clicking the bookmark tab for this script directly gives me posts in which I was mentioned without even having to click 'search':
Link for 'Was I mentioned?'
CODE
<html>
<head>
<title>GTAF Search</title>
</head>
<body>
<script type="text/javascript">
function myfunc () {
var frm = document.getElementById("submit");
frm.submit();
}
window.onload = myfunc;
</script>
<form action="http://www.gtaforums.com/index.php?act=Search&CODE=01" method="post" name="sForm" id="submit">

<div align="center">

<b>GTAF</b> <input type="submit" value="Search" class="forminput">
<br>
<br>
<table>

<tr>
<td>
<input type="text" maxlength="100" size="40" name="keywords" id="keywords" class="forminput" value="be smart here, use search operators to cover all posts mentioning you">
</td>
<td>
<label for="keywords">Enter keywords to search</label>
</td>
</tr>

<tr>
<td>
<input type="text" maxlength="100" size="40" name="namesearch" id="MemberName" class="forminput">
</td>
<td>
<label for="membername">By Member Name</label>
</td>
</tr>

<tr>
<td>
</td>
</tr>

<tr>
<td>
<input type="radio" name="search_in" class="radiobutton" id="search_in_posts" value="posts" checked="checked"><label for="search_in_posts">Search entire posts</label>
</td>
<td>
<input type="radio" name="search_in" class="radiobutton" id="search_in_titles" value="titles"><label for="search_in_titles">Search topic titles only</label>
</td>
</tr>

<tr>
<td>
<input type="radio" name="result_type" class="radiobutton" value="posts" id="result_posts" checked="checked"><label for="result_posts">Show results as posts</label>
</td>
<td>
<input type="radio" name="result_type" class="radiobutton" value="topics" id="result_topics"><label for="result_topics">Show results as topics</label>
</td>
</tr>

</table>

</div>

<input type="hidden" name="exactname"value="1">
<input type="hidden" name="forums[]" value="all">
<input type="hidden" name="searchsubs" value="1">
<input type="hidden" name="prune" value="0"">
<input type="hidden" name="prune_type" value="older">
<input type="hidden" name="prune_type" value="newer">
<input type="hidden" name="sort_key" value="last_post">
<input type="hidden" name="sort_order" value="desc">

</form>

</body>

</html>

OzzySM12
  • OzzySM12

    Hmm...

  • Members
  • Joined: 07 Nov 2004

#2

Posted 04 January 2013 - 05:57 PM

You really need to indent your code. It is very bad programming just to have everything like that.
Also;
tbody is not needed unless you are using thead & tfoot and CSS to format a table.
class= & id= is only needed for CSS/JavaScript

Here is what you should be looking to have
CODE
<html>
<head>
 <title>GTAF Search</title>
</head>
<body>
 <form method="post" name="sForm" action="http://www.gtaforums.com/index.php?act=Search&amp;CODE=01">
  <div align="center">
   <b>GTAF</b>
   <input value="Search" type="submit">
   <br><br>
   <table>
    <tr>
     <td>
      <input name="keywords" maxLength="100" value="deept*" size="40" type="text" />
     </td>
     <td>
      <label for="keywords">Enter keywords to search</label>
     </td>
    </tr>
    <tr>
     <td>
      <input name="namesearch" maxLength="100" size="40" type="text">
     </td>
     <td>
      <label for="membername">By Member Name</label>
     </td>
    </tr>
    <tr>
     <td></td>
    </tr>
    <tr>
     <td>
      <input name="search_in" value="posts" checked="checked" type="radio"><label for="search_in_posts">Search entire posts</label>
     </td>
     <td>
      <input name="search_in" value="titles" type="radio"><label for="search_in_titles">Search topic titles only</label>
     </td>
    </tr>
    <tr>
     <td>
      <input name="result_type" checked="checked" value="posts" type="radio"><label for="result_posts">Show results as posts</label>
     </td>
     <td>
      <input name="result_type" value="topics" type="radio"><label for="result_topics">Show results as topics</label>
     </td>
    </tr>
   </table>
  </div>
  <input name="exactname" value="1" type="hidden">
  <input name="forums[]" value="all" type="hidden">
  <input name="searchsubs" value="1" type="hidden">
  <input name="prune" value="0" type="hidden" ?="">
  <input name="prune_type" value="older" type="hidden">
  <input name="prune_type" value="newer" type="hidden">
  <input name="sort_key" value="last_post" type="hidden">
  <input name="sort_order" value="desc" type="hidden">
 </form>
</body>
</html>


Everyone is different though so see what indentation you prefer doing. Personally I would do;
CODE
    <tr>
     <td><input id="result_posts" class="radiobutton" name="result_type" checked="checked" value="posts" type="radio"><label for="result_posts">Show results as posts</label></td>
     <td><input id="result_topics" class="radiobutton" name="result_type" value="topics" type="radio"><label for="result_topics">Show results as topics</label></td>
    </tr>


Other than that well done.

P.S. Although it shows up at spaces when I post the code, I actually do it with Tab's.

nightwalker83
  • nightwalker83

    Don't mind me

  • Members
  • Joined: 10 Oct 2004

#3

Posted 06 January 2013 - 09:47 AM

You could probably keep the same layout using css instead of tables too.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users