Jump to content

[SOLVED] Removing an option from the search from


hrnn

Recommended Posts

Hi, im using the audio only mod or PHPMOTION SCRIPT, this is my site www.underz.com.ar

and im doing some cleanning on the code.

And since only audios can be uploaded an of course only audios can be searched, i want to remove the audio option on the search form

audiosearchvj0.png

w382.png

i know i have to edit search.php and templates/main_1.htm

 

THis is the search form in templates/main_1.htm

<form class="FormSearch" method="POST" action="search.php">
<input type="text" name="keyword" size="32" class="FormSpecialInput_1" />
      <select size="1" name="type" class="FormSpecialInput_1">
           <option value="audio">Audio</option>
      </select>
<input type="submit" value="Submit" name="B2" />
</form>

And the audio option is what i want to remove

 

This is part of the search.php code, which i also think i have to edit.

<?php

include_once ('classes/config.php');

include_once ('classes/menu.php');
include_once ('classes/sessions.php');
include_once ('tag_cloud_audio.php');

$referer = mysql_real_escape_string($_SERVER['HTTP_REFERER']);
$keyword = $_POST['keyword'];//get video id
$type = mysql_real_escape_string($_POST['type']);//get video id

//check if this page is being called from "next>>" or "<<previous" where the keyword are not POST but GET
if ($type == '') {

    $keyword = mysql_real_escape_string($_GET['keyword']);
    $type = mysql_real_escape_string($_GET['type']);

}

$get_keywords = $keyword;//also send keyword to html
$get_type = $type;//also send type to html


// Start of AUDIO SEARCH 

if ($type == 'audio' || $type == '') {
    $limit = $config["search_page_limits"];
    $keyword_escaped = mysql_real_escape_string($keyword);
    $pagination = pagination("SELECT * FROM audios WHERE MATCH(title, tags, description) AGAINST ('$keyword_escaped') AND approved='yes' AND public_private = 'public'",
        $limit);

 

I removed  this in the main_1.htm

<option value="audio">Audio</option>

but then the search didnt work, and listed every song uploaded.

Any idea of how to remove that option of the image?

Thanks

Link to comment
Share on other sites

You will have to remove anything to do with "type".

 

From main_1.html take out:

 

      
           Audio
      

 

search.php take out:

 

$type = mysql_real_escape_string($_POST['type']);//get video id

 

if ($type == '') {

 

    $type = mysql_real_escape_string($_GET['type']);

}

 

$get_type = $type;//also send type to html

 

if ($type == 'audio' || $type == '') {

 

Take out everything that has to do with "type".  You may want to post more of the code if that doesn't work.

Link to comment
Share on other sites

Thanks for answering

I deleted every "type" on the search.php.

But, the search results to any word, not even a tag, are all songs uploaded.

It doesnt matter what term do i search, the result is a list of all songs uploaded.

How do i fix this?

Link to comment
Share on other sites

 

BUT the way i solved it adding an

<input type="hidden" name="type" value="audio" />

 

so i did quit the option from the form as its shown on the image

 

<form class="FormSearch" method="POST" action="search.php">
    <input type="text" name="keyword" size="32" class="FormSpecialInput_1" />
    <input type="hidden" name="type" value="audio" />
    <input type="submit" value="Search" name="B2" />
</form>

Link to comment
Share on other sites

 

BUT the way i solved it adding an


 

so i did quit the option from the form as its shown on the image

 

</pre>
<form class="FormSearch" method="POST" action="search.php">
    
    
    
</form

 

I can see how that works.  But you said Audio is the only choice anyway so why even include it, even if it's hidden?

Link to comment
Share on other sites

sure, thats why i posted firstly

the original script had many options i.g. videos, music, members, groups, etc

so the search.php whas prepared for that.

When i did what you said, the search results where all songs uploaded.

 

But now with this hidden, "No matter if the cat is white or black while hunt mice" :D

Of course i would prefere what you say

Link to comment
Share on other sites

sure, thats why i posted firstly

the original script had many options i.g. videos, music, members, groups, etc

so the search.php whas prepared for that.

When i did what you said, the search results where all songs uploaded.

 

But now with this hidden, "No matter if the cat is white or black while hunt mice" :D

Of course i would prefere what you say

 

Hrmmm, I see.  ::)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.