Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
iframe search bar
Goto page 1, 2  Next
 
Reply to topic    Forum Index » Additional Downloads View previous topic
View next topic
iframe search bar
Author Message
scottdallas



Joined: 04 May 2006
Posts: 2027
Location: US

Post iframe search bar Reply with quote
This is how you put an iframe search bar anywhere you want on your site:



From the .zip file:

1) Copy search.php to / (root directory of cutenews.ru install)

2) Copy show_searchresults.php to / (root directory of cutenews.ru install)

3) Copy search.css to /skins (root directory of cutenews.ru install)



Changing search fonts using search.css:

1) Open search.css and change the font properties.

- - 'fontyfont' is formatting for the words 'Search for:'

- - 'fontyfont-search' is formatting for text in search box.

- - 'fontyfont-dropdown' is formatting for text in both drop downs.



--------

Note: You'll also see this at the top of skins/search.css



body {

background-color: transparent;

}



This sets the background of the iframe transparent so no matter where you place this search bar iframe on your site it will match the background behind it.. like the background of a table or cell that you've previously chosen in your layout. This makes it easier to design with. I've tested it with IE and FF.

--------



How to display search bar in your site:

1) Use the code below on your site wherever you'd like to show the search bar.



<iframe name="searchbar" src="http://www.YOURSITE.com/PATH-TO-CUTENEWS/search.php" allowtransparency="yes" marginwidth="1" marginheight="1" width="100%" scrolling="no" border="0" frameborder="0" height="100">You need a browser upgrade. Get firefox.</iframe>



The things you'll need adjust in the iframe code to make it work for your site are:



1) src="http://www.YOURSITE.com/PATH-TO-CUTENEWS/search.php"

2) height="100"



How to include search results in your site:

To see the search results on your page, include them into a file called 'search.php' in the root directory of your website. This is exactly like including show_news.php on your index.php file. Because of this I usually copy index.php as search.php (creating http://www.yoursite.com/search.php) and change the include code to this:



<?php

$number = "10";

include("PATH-TO-CUTENEWS/show_searchresults.php");

?>



Some extra info:

You can change the page that cutenews.ru opens search results on by changing this line in search.php:



<form method="get" action="../search.php" target="_top">



Change action="../to-the-name-of-the-file-youd-like-to-use.php"



target="_top" tells it to open in a new window. Without this it will open inside of your tiny search iframe.



You can change which template your search results use in cutenews.ru by modifying this line in search.php:



$template = 'Search';



iframe-search.zip
 Description:
Extract files to root directory of cutenews.ru

Download
 Filename:  iframe-search.zip
 Filesize:  6.07 KB
 Downloaded:  113 Time(s)


_________________
www.scodal.com is an example of cnr as a social forum - www.scottdizzle.com is an example of cnr as a personal website to share whatever cool stuff i feel like. i have another, but it's nsfw. pm me Wink

Last edited by scottdallas on Wed May 09, 2007 7:10 pm; edited 3 times in total
Sat May 05, 2007 4:36 pm View user's profile Send private message Visit poster's website AIM Address
Guest








Please login to hide the ads.

astrostart



Joined: 11 Feb 2007
Posts: 124
Location: The Netherlands

Post Reply with quote
Wow, this looks cool.



Do you have a preview so I can check it out before installing it?

_________________
My site: http://www.astrostart.nl | Thanks to everyone here who has helped me!
Sun May 06, 2007 3:42 pm View user's profile Send private message Visit poster's website
yesitsfree



Joined: 03 May 2007
Posts: 89

Post Reply with quote
Excellent Thanks for this

I now have it working on my site

Although I had to remove some code out of the show_searchresults.php page due to security errors on my hosting server the part I removed was



Code:
//Search history start

$file_path = "../data/search-history.txt";



if(!file_exists($file_path)) touch($file_path);



$search_file = file($file_path);



if($search){



function plus_one(){

global $search_file, $search, $file_path;



$file = fopen($file_path, w);



   foreach($search_file as $line){

      $line_arr = explode("|", $line);

      if(trim($line_arr[1]) == trim($search)){

         $count = $line_arr[0]+1;

         fwrite($file, $count."|".$line_arr[1]);

      }

      else fwrite($file, $line);

   }

fclose($file);

}



foreach($search_file as $line){

   $line_arr = explode("|", $line);

   $all_words[] = trim($line_arr[1]);

}





   if(in_array($search, $all_words)){

      plus_one();

   }

   else {

      $add_file = fopen($file_path, a);

      fwrite($add_file, "1|".$search."\n");

      fclose($add_file);

   }





}

//Search history end





now works fine

see at www.security4free.co.uk new site being developed so not much on it.

_________________
yesitsfree freeware http://www.yesitsfree.co.uk
Security4free http://www.security4free.co.uk
UK community website directory http://www.wvis.co.uk
Holiday Lets Directory ttp://www.holidayletsdirectory.com
Sun May 06, 2007 7:23 pm View user's profile Send private message Visit poster's website
scottdallas



Joined: 04 May 2006
Posts: 2027
Location: US

Post Reply with quote
Sure, I'm using this search bar on:



http://www.scottdizzle.com

http://www.dream-library.com

http://www.tastypolls.com

http://www.doodledrawings.com

http://www.whatsmostpopular.com



If you see a search bar, you see it working.

_________________
www.scodal.com is an example of cnr as a social forum - www.scottdizzle.com is an example of cnr as a personal website to share whatever cool stuff i feel like. i have another, but it's nsfw. pm me Wink
Sun May 06, 2007 7:31 pm View user's profile Send private message Visit poster's website AIM Address
yesitsfree



Joined: 03 May 2007
Posts: 89

Post Reply with quote
maybe just the hosting i am using they are a bit restricted with what you can use

_________________
yesitsfree freeware http://www.yesitsfree.co.uk
Security4free http://www.security4free.co.uk
UK community website directory http://www.wvis.co.uk
Holiday Lets Directory ttp://www.holidayletsdirectory.com
Sun May 06, 2007 7:33 pm View user's profile Send private message Visit poster's website
scottdallas



Joined: 04 May 2006
Posts: 2027
Location: US

Post Reply with quote
Ah and now http://www.security4free.co.uk/ has a working example Smile I'm glad you got it working. looks and works great. fast and easy Smile



You could change the text here:



Code:
Your Search Results Are Below




to



Code:
Your Search Results for '<b><?php echo("$search"); ?></b>' Are Below




If you want to display the keyword they searched

_________________
www.scodal.com is an example of cnr as a social forum - www.scottdizzle.com is an example of cnr as a personal website to share whatever cool stuff i feel like. i have another, but it's nsfw. pm me Wink

Last edited by scottdallas on Sun May 06, 2007 7:36 pm; edited 1 time in total
Sun May 06, 2007 7:34 pm View user's profile Send private message Visit poster's website AIM Address
yesitsfree



Joined: 03 May 2007
Posts: 89

Post Reply with quote
Yep THANKS for your help Scott

_________________
yesitsfree freeware http://www.yesitsfree.co.uk
Security4free http://www.security4free.co.uk
UK community website directory http://www.wvis.co.uk
Holiday Lets Directory ttp://www.holidayletsdirectory.com
Sun May 06, 2007 7:36 pm View user's profile Send private message Visit poster's website
yesitsfree



Joined: 03 May 2007
Posts: 89

Post Reply with quote
Just added "Your search results for "" are below



Great thanks again

_________________
yesitsfree freeware http://www.yesitsfree.co.uk
Security4free http://www.security4free.co.uk
UK community website directory http://www.wvis.co.uk
Holiday Lets Directory ttp://www.holidayletsdirectory.com
Sun May 06, 2007 7:39 pm View user's profile Send private message Visit poster's website
scottdallas



Joined: 04 May 2006
Posts: 2027
Location: US

Post Reply with quote
yeah! that looks sweet!

_________________
www.scodal.com is an example of cnr as a social forum - www.scottdizzle.com is an example of cnr as a personal website to share whatever cool stuff i feel like. i have another, but it's nsfw. pm me Wink
Sun May 06, 2007 7:49 pm View user's profile Send private message Visit poster's website AIM Address
yesitsfree



Joined: 03 May 2007
Posts: 89

Post Reply with quote
Yep works great.

Going to get www.security4free.co.uk loaded with software and then Im going to convert yesitsfree to cutenews.ru will take some doing though I have about 600 listings on static pages also worried about losing my google ranking, it is about 4/10 at the moment but all the pages are htm will I loose rankings when I convert to php.

_________________
yesitsfree freeware http://www.yesitsfree.co.uk
Security4free http://www.security4free.co.uk
UK community website directory http://www.wvis.co.uk
Holiday Lets Directory ttp://www.holidayletsdirectory.com
Sun May 06, 2007 8:01 pm View user's profile Send private message Visit poster's website
astrostart



Joined: 11 Feb 2007
Posts: 124
Location: The Netherlands

Post Reply with quote
I have installed it on my website: www.astrostart.nl (upper right corner)



If I search for one word, it works fantastic, but when I search for two words, it can't find anything.



For instance:



zwart - enough results

zwart gat - no results



That's weird, because there are a lot of news with zwart gat (black hole) on my site.



Do you have a solution? Razz

_________________
My site: http://www.astrostart.nl | Thanks to everyone here who has helped me!
Tue May 08, 2007 11:56 am View user's profile Send private message Visit poster's website
astrostart



Joined: 11 Feb 2007
Posts: 124
Location: The Netherlands

Post Reply with quote
And another question (yeah, I'm annoying)



This is my template for next and previous news:



Code:
<p align=center>[prev-link]<< Nieuwere berichten[/prev-link] | [next-link]Oudere berichten >>[/next-link]</p>




However, when I'm on the search page and click 'oudere berichten' (older messages) it takes me to the following link:



http://www.astrostart.nl/search.php?skip=10



And I can't see any newsmessages. Do you have a solution for this? Sad [/code]

_________________
My site: http://www.astrostart.nl | Thanks to everyone here who has helped me!
Tue May 08, 2007 12:02 pm View user's profile Send private message Visit poster's website
scottdallas



Joined: 04 May 2006
Posts: 2027
Location: US

Post Reply with quote
Does this fix it? When I had bad search result pagination links FI-DD helped me here



http://english.cutenews.ru/forum/viewtopic.php?t=908&highlight=search+pagination



and I uploaded the zip of the file with the modifications he helped me make in case anyone else had similar issues. As far as the mulitple word search.. I have trouble with that too Sad i think that's not the iframe-search having trouble but the search code itself.

_________________
www.scodal.com is an example of cnr as a social forum - www.scottdizzle.com is an example of cnr as a personal website to share whatever cool stuff i feel like. i have another, but it's nsfw. pm me Wink
Wed May 09, 2007 1:49 am View user's profile Send private message Visit poster's website AIM Address
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2857
Location: Germany

Post Reply with quote
You have to install the boolean search if you want to search for more than one word.
Wed May 09, 2007 6:07 pm View user's profile Send private message
astrostart



Joined: 11 Feb 2007
Posts: 124
Location: The Netherlands

Post Reply with quote
Well, I did. But now I've overwritten it with this search.php file. So now it is not possible anymore Razz

_________________
My site: http://www.astrostart.nl | Thanks to everyone here who has helped me!
Wed May 09, 2007 6:29 pm View user's profile Send private message Visit poster's website
Display posts from previous:    
Reply to topic    Forum Index » Additional Downloads All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.