You are not logged in.

Announcement

Forum database was corrupt and an old backup was restored as temporary replacement. Registrations closed until the database is recovered. Please ask questions using the Contact form

#1 19-06-2013 13:19:54

MagnusKrushwitz
Contributors
Registered: 21-03-2013
Posts: 2

Searchbar

Dear programmer,

is there a possibility to make a searchbar? I'd like to search at my homepage for content and link to the page.


Yours


Magnus

Offline

#2 19-06-2013 14:18:43

Pie
Contributors
From: Germany
Registered: 17-03-2013
Posts: 366
Website

Re: Searchbar

Hi Magnus,

not the programmer, but anyways big_smile

I'm working on that topic myself right now. Check my site and let me know, if this is what you want.
Search itself is not yet implemented, though! As i said, work in progress...

- Pie

Offline

#3 19-06-2013 15:47:29

Pie
Contributors
From: Germany
Registered: 17-03-2013
Posts: 366
Website

Re: Searchbar

Hi again,

you may want to check out http://webdesignerwall.com/tutorials/ex … earch-form

- Pie

Offline

#4 19-06-2013 16:14:41

Thomas
Administrator
Registered: 10-03-2013
Posts: 897

Re: Searchbar

The search thing itself would be the most difficult thing. Since page content isn't stored in a database, you can't use standard mysql queries. Maybe there's a tutorial out there for a search function with html/php pages, or you could use googel search for the search results.

Offline

#5 19-06-2013 18:56:42

Pie
Contributors
From: Germany
Registered: 17-03-2013
Posts: 366
Website

Re: Searchbar

Hi Thomas,

i have found a quite difficult but at least working indexer.

It's not a crawler though, you have to "tell" the DB your data "by hand".
However, since phpDig (a former php-crawler i used) does now create SQL errors on my up-to-date server, i have to use whatever alternative i can find smile

I'm adding the pages right now, so far, some search terms are already working.

If you go on my website and search for "agb", it opens the result page.

My problem: how do i get this page to be displayed within my styled content instead of what you see now?

regards
- Pie

Last edited by Pie (19-06-2013 19:04:39)

Offline

#6 21-06-2013 12:07:57

Pie
Contributors
From: Germany
Registered: 17-03-2013
Posts: 366
Website

Re: Searchbar

Hi Thomas,

could you help me with that? It's rather important to me tongue

Sorry for nagging wink

- Pie

Offline

#7 21-06-2013 19:50:20

Thomas
Administrator
Registered: 10-03-2013
Posts: 897

Re: Searchbar

Isn't it possible to just manually theme the search page?

Offline

#8 21-06-2013 22:52:40

Pie
Contributors
From: Germany
Registered: 17-03-2013
Posts: 366
Website

Re: Searchbar

Sorry,

you just lost me...

when I "theme" the page, the page would have the same color scheme, but it would not be displayed within the content part of the website. It opens as a whole new page.

The file to be called is "search/search.php" and has a lot of subfolders. It is not in the "pages/" folder...

This is the code of the search-box:

<!-- SUCHE START-->    
    <div id="coolsearch">
    <form method="get" action="search/search.php">
		<input type="search" name="q" placeholder="Suche... (beta)" />
	</form>
    </div>
<!-- SUCHE END-->    

So my question is, what do i have to do, to get the "external" search result page to be displayed inside my content area, like every other page on my website?

regards

-Pie

Last edited by Pie (21-06-2013 23:00:43)

Offline

#9 25-06-2013 17:01:46

Thomas
Administrator
Registered: 10-03-2013
Posts: 897

Re: Searchbar

It'll require some javascript code.

You need to change the form so it'll submit it so the url becomes

yoursite.com/#!/search?q=the-search-query

Then in the search subpage, you'll need to use an iframe with the normal search page.

(the url of the iframe can be known by check the url of the real page)

Offline

#10 25-06-2013 17:14:06

Pie
Contributors
From: Germany
Registered: 17-03-2013
Posts: 366
Website

Re: Searchbar

Hi Thomas,

you wouldn't have that java-script, would you?

I have no idea, how to do that unfortunately...

A question: Can't you make it just possible to have pages in different subfolders instead only the pages folder?

I don't like iframes very much... :-)

- Pie

Offline

#11 26-06-2013 10:54:56

paulineccl
Contributors
Registered: 25-05-2013
Posts: 37

Re: Searchbar

This is a very good idea. Think about this before, but quite hard to implement. So, it is long forgotten, hoho. Personally, my idea is to have an internal search engine (offline and standalone db will be the best) to look for:
- page titles & contents (including tiles, link titles and paths within)
- panel contents (including tiles, link titles and paths within)
- tile labels, descriptions and urls (or extra tags)
Once found, results are listed (in pagination for each 10 results as example) for further selection. Admin site allows to regenerate the indexes to db (eg sqlite).

My previous references:
http://davidejones.com/blog/520-simple- … hp-sqlite/
http://www.debian-administration.org/ar … ur_website

Last edited by paulineccl (26-06-2013 11:21:50)

Offline

#12 27-06-2013 13:39:34

Pie
Contributors
From: Germany
Registered: 17-03-2013
Posts: 366
Website

Re: Searchbar

does the first one also work with mySQL?

- Pie

Offline

#13 27-06-2013 14:09:24

paulineccl
Contributors
Registered: 25-05-2013
Posts: 37

Re: Searchbar

The 1st reference is for PHP + SQLite, because i prefer to have offline and standalone db.

This is a sample of pagination search engine for PHP + MySQL:
http://www.findsourcecode.com/php/php-m … ch-engine/

Hope it helps you.

Last edited by paulineccl (27-06-2013 14:10:40)

Offline

#14 27-06-2013 14:11:36

Pie
Contributors
From: Germany
Registered: 17-03-2013
Posts: 366
Website

Re: Searchbar

Thanks,

I'll look into it and share, if successful (or not) smile

- Pie

Offline

#15 27-06-2013 22:11:02

Pie
Contributors
From: Germany
Registered: 17-03-2013
Posts: 366
Website

Re: Searchbar

Hi pauline,

i took a shot and set up db and files (http://www.netzwerkstudio.de/#!/suche)
When i was finished, i realized, this has no autoindexer as well sad

There was such a script once, called "phpDig" i used it a lot, but it doesn't work on the new mySQL Server anymore sad

However, does anyone know how to autoindex (via php) all files and automatically put them into the database?

Otherwise you have to fill the db manually, that is not really cool and in my case a lot of work. Also, when the page is updated, the database should be able to reindex (either on demand via shell script or automatically via cronjob) the files.

Perhaps somebody has an idea / resource to share?!

regards
- Pie

Last edited by Pie (28-06-2013 14:05:13)

Offline

#16 29-06-2013 11:37:16

paulineccl
Contributors
Registered: 25-05-2013
Posts: 37

Re: Searchbar

Thanks for sharing the test results, Pie. I will take a deep look into it once I'm free smile

Anyway, I think it is still possible to code it with a button at admin panel to regenerate the indexes. So every time we have change something related on the pages, we shall push this button for the index regeneration. For auto-scheduling, using the cron-job to run the php script with www-data user.

However, we must code the regenerate button first to: collect, filter and sort all the information (eg tile label, title etc) that we're needed as the indexes, then store it to the db. Else, i don't think it can work ideally in current condition.

Last edited by paulineccl (29-06-2013 11:50:58)

Offline

#17 02-07-2013 16:10:34

Pie
Contributors
From: Germany
Registered: 17-03-2013
Posts: 366
Website

Re: Searchbar

Pie wrote:

Hi Thomas,

you wouldn't have that java-script, would you?

I have no idea, how to do that unfortunately...

A question: Can't you make it just possible to have pages in different subfolders instead only the pages folder?

I don't like iframes very much... :-)

- Pie

Still need help with URL stuff... :-)

- Pie

Last edited by Pie (02-07-2013 16:11:22)

Offline

Board footer

Powered by FluxBB