A Few questions

tubeman
Posts: 534
Joined: Sat Mar 02, 2013 11:33 am

A Few questions

Post by tubeman »

Hi,
Had a few questions:

1.) Suppose user makes a search "Hot Thai Babe Fucking" but we have only 2 galleries that have those exact searches and in the output page we only get 2 galleries, how do we fill the search page with other galleries we well that have words "Hot","Thai", "Babe" and "Fucking" ?

2.) Now when user searches for "Hot Thai Babe Fucking" we get output something like:
domain.com/search/Hot Thai Babe Fucking/page1.html

but if I want out like this:
domain.com/search/Hot-Thai-Babe-Fucking/page1.html
how do I get this?

3.) How do I output Random user searches on different pages of site for example page1.html , page2.html...

4.) Suppose I import data and I don't want to create thumbs on my server instead use the thumb from the original site, how can I do this?

Regards,
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: A Few questions

Post by admin »

Hi!

1. Use sphinx , set

Sphinx Search Mod
for advanced user only, do not change if you are not sure

to SPH_MATCH_ANY


2. there are 2 parts
- front: when user clicks at 'search' - make location.href = ... create URL the way you want it to be
- server side: add a rewrite into .htaccess that converts domain.com/search/Hot Thai Babe Fucking/page1.html into a regular domain.com/?search=Hot Thai Babe Fucking

3. usually it's like

<thumb search_log=all num=1-10> <!--SEARCH_QUERY--> </thumb>

unfortunately at present moment there's no 'random' option, if you need it we can add it

4. in Import

Copy Thumbs to server ? = hotlink
Don't forget to run script update
tubeman
Posts: 534
Joined: Sat Mar 02, 2013 11:33 am

Re: A Few questions

Post by tubeman »

Hi,

1.) Is it possible to do this without sphinx?

2.) Whats the exact rewrite in .htaccess I need to achieve this for all searches?

Regards,
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: A Few questions

Post by admin »

1. probably newer version of mysql can do it, but i'm not 100% sure

why don't want to use sphinx?


2. something like

RewriteRule ^search/([^/]+)/page1.html$ /?search=$1&%{QUERY_STRING} [L]

but please take a look at mod_rewrite docs )
Don't forget to run script update
tubeman
Posts: 534
Joined: Sat Mar 02, 2013 11:33 am

Re: A Few questions

Post by tubeman »

Hi,
Have many sites so for each site will have to configure sphinx? Is it easy to install and implement?
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: A Few questions

Post by admin »

if all of your sites use the same db - just 1 time

otherwise - yes, but mostly it's just copy\paste a part of a config file, you'll need to change DB name only
Don't forget to run script update
tubeman
Posts: 534
Joined: Sat Mar 02, 2013 11:33 am

Re: A Few questions

Post by tubeman »

Hi,
For 2 I did the first part and in URL I got:

domain.com/search/Hot-Thai-Babe-Fucking/page1.html

But issue is that in results it dosen't show the galleries when user searches for "Hot Thai Babe Fucking" it shows results for "Hot-Thai-Babe-Fucking" instead which has no galleries.I just want to add "-" in between the words searched instead of the space but user should get galleries for actual search term "Hot Thai Babe Fucking". The rewite is correct as without it search results would not be displayed. Any idea how to add the "-" between the words instead of the space and also get the same output on:

<thumb search_log=all num=1-10> <!--SEARCH_QUERY--> </thumb>
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: A Few questions

Post by admin »

in common.php add

if (isset($_GET['search'])) $_GET['search'] = str_replace('-', ' ', $_GET['search']);
Don't forget to run script update
tubeman
Posts: 534
Joined: Sat Mar 02, 2013 11:33 am

Re: A Few questions

Post by tubeman »

Hi,
Thanks that worked. Only when I am outputting on template using:

<thumb search_log=all num=1-10> <!--SEARCH_QUERY--> </thumb>

It dosen't show the search term with the "-". How do I get the output of the search query with the "-" on the template using <!--SEARCH_QUERY-->?

Also In Nginx rewrite suppose at the end of slug I don't want the "/", what do I change in the re-write below?

rewrite "^/search/([^/]+)/([^/]+)/$" "/?search=$1&page=$2&$args" ;

Right now its
domain.com/search/something/1/

I want it as
domain.com/search/something/1

Please let me know.

Regards,
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: A Few questions

Post by admin »

<thumb search_log=all num=1-10>

<?php echo str_replace(' ', '-', '<!--ESCAPED_SEARCH_QUERY-->'; ?>

</thumb>


http://smartcj.com/wiki/doku.php?id=new ... tag_prefix


Last slash - so just remove the last slash from your rewrite. Please, take a look at mod_rewrite docs
Don't forget to run script update
Post Reply