Page 1 of 1

Sphider template bootstrap

Posted: Sat Nov 24, 2018 5:53 pm
by Rabattkod
Hello all. I have installed spider themplate from github here but i cant get it to work. When i search for something it shows blank page. Can someone please help me with this.


Re: Sphider template bootstrap

Posted: Sat Nov 24, 2018 8:42 pm
by captquirk
I'll have to look at this template in more detail. My offhand suspicion is that this template was coded for the ORIGINAL Sphider 1.3.6, from which Sphider 2.1 is descended. But Sphider 2.1 is has undergone MANY changes since 1.3.6. This template may no longer be compatible.
But, as I said, I will need to look at it in more detail.

UPDATE: Just a cursory look at this template reveals some major incompatibilities and I haven't even looked at the code yet!
1) All the template files are located in the templates/bootstrap folder, just like in the original Sphider (1.3.6 and earlier). Since typical templates have a lot of overlap, some of these files were identical from one template to another, making for a lot of duplication. As a result, 4 of these files were relocated to a new folder, common_template. These files also had a bit of a rename, becoming categories.php, search_form.php, search_results.php, and foot.php. Only header.html and search.css remained in the template/[whatever] folder, as they are unique.
2) To use bootstrap, the categories.php, search_form.php, search_results.php, and foot.php would need to be replaced, rendering all existing templates inoperable. For a custom installation in which ONLY bootstrap would be used, that would not be an issue. The corresponding .html files would need to be converted to .php, but probably no insurmountable.

You could try this out by moving and renaming categories.html, search_form.html, search_results.html, and footer.html to corresponding .php (backing up the existing files of the same name, of course) and see what happens. There may still be code inconsistencies, but that could be fixed.

If I get a chance, I might try that out. No promises.

UPDATE 2: I see the bootstrap header.html has two issues. It uses SuggestFramework.css and SuggestFramework.js. SuggestFramework no longer exists in Sphider, The suggest.php has been completely rewritten and relocated. Another issue is that the header.html uses a bit of php. This was one of the many security issues with the original 1.3.6 version, in that php was used in files with a html extension, allowing users to see your php code!

It looks like the bootstrap template would need a rewrite to work in Sphider 2.*.

Re: Sphider template bootstrap

Posted: Sun Nov 25, 2018 7:45 am
by ReddWebDev
Sphider templates are so light and fast that all bootstrap would do is slow it down with an assorted number of unnecessary elements.
Fat code is great if you want a fat site, and this particular Sphider build is anything but fat.

Bootstrap is more about making money than it is about being proficient anyway, and I usually avoid it.

There's nothing so wrong with the existing code that a bit of CSS couldn't fix - And when I'm done, you'll be looking at it on your phone for days.

Re: Sphider template bootstrap

Posted: Sun Nov 25, 2018 5:13 pm
by captquirk
Getting an idea overnight, I gave this a try:
In Sphider, rename search.php to search-new.php.
Rename search-160.php to search.php.
In the common_templates folder, create a new subfolder named save.
Move categories.php, footer.php, search_form.php, and search_results.php to the "save" folder.
From the templates/bootstrap folder, move categories.html, footer.html, search_form.html, and searcdh_results.html to the "common_templates" folder.
Rename these four files by changing the ".html" to ".php".
In search_form.php and search_results.php, change all references of "quote_replace" to "quoteReplace", and remove all calls to "addmarks". When removing addmarks, remember to adjust the the "()" pairs.

The process basically works. Code edits need work. At the bottom of the search results, "Help", "Privacy", and "Terms" simply take you back to the top of the page, while "Donate" takes you to a page to donate to a dead project!

The three symbols at the extreme top left are very pretty... but do absolutely nothing.

While all of this now works, the code is pretty messy with jumps back and forth between html and php. There is also the issue of all the other templates being broken. If the intent is never to use any of them, then that isn't an issue.

On the other hand, if you wanted BOTH capabilities, that wouldn't be impossible. With the distrubuted categories.php, footer.php, search_form.php, and search_results.php, you would do this:
Above the first line of code in each, put in the line: "if ($template != "bootstrap") {".
Now go to the bottom of each file and put in the following, starting on a new line:
"} else { ?>"
Below that, enter the entire contents of the corresponding html files.
Finally, after that, the nest line would be: "<?php }"
No closing "?>" is needed.

Categories.php, footer.php, search_form.php, and search_results.php will be larger, but the server will build only what is needed so what the user downloads will not be basically the same.

The reason you would want to use the search-160.php in lieu of the distrubuted search.php is that search.php is also designed for RSS and Image searches of the Sphider database.