 |

jposwald
User
May 8, 2008, 1:25 PM
Post #1 of 28
(1669 views)
Shortcut
|
Dave, I downloaded the multiSearch.php file. How can I make a search box to all pages and the results being displayed in Search.php? Is that possible? Also, is there an option to put in the code which sections will be searched? Best Regards, Juan.
|
|
|  |
 |

Dave
Staff
/ Moderator

May 8, 2008, 3:49 PM
Post #2 of 28
(1663 views)
Shortcut
|
Hi Juan, You can add a search box to all your pages with some code like this:
<form method="GET" action="/path/to/your/search.php"> <input type="text" name="q" value="" size="50"> <input type="submit" name="" value="Search"><br/><br/> </form> And you can edit multiSearch.php (or search.php if you renamed it that) and add section with a block of code like this:
$searchTables['quotes'] = array( 'viewerUrl' => 'quotesPage.php', 'titleField' => 'name', 'summaryField' => 'quote', 'searchFields' => array('name','pullQuote','quote'), ); You'll see a few of those in there. Just erase the ones you don't want and add one for each section you want to search. This is a new feature so it's a little code heavy. In future we'll likely add some menus to automatically generate a multi section search engine. Hope that helps! Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

jposwald
User
May 14, 2008, 12:59 AM
Post #3 of 28
(1626 views)
Shortcut
|
Great!, I have a doubt, can I highlight entered search box keyword in search results?
|
|
|  |
 |

Dave
Staff
/ Moderator

May 14, 2008, 9:04 AM
Post #4 of 28
(1607 views)
Shortcut
|
No, it doesn't highlight the keyword in the search results. And it only shows the summary field content, not little snippets of text from all the fields that match (like google does). Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

jposwald
User
May 14, 2008, 1:08 PM
Post #5 of 28
(1595 views)
Shortcut
|
:( let's add it to next features of CMS!
|
|
|  |
 |

jposwald
User
May 22, 2008, 12:00 PM
Post #6 of 28
(1506 views)
Shortcut
|
Dave I have a problem with my Search page. I'm testing it putting keywords that are in tables but it tells me "no results has found" http://www.worldwidetrainings.com/Search.php Meaby there is a little error, but I think I did it right because after to put all arrays it worked (when I had only 2 arrays to search) I attached you Search.php Thank you for your help, Juan.
|
|
Attachments:
|
Search.php
(33.2 KB)
|
|
|  |
 |

einslistir
User
May 22, 2008, 2:56 PM
Post #7 of 28
(1503 views)
Shortcut
|
Hi, jposwald! I took a look at your site. Are the drop down menus dynamic or hardcoded? It looks very nice! Sorry, I just ask you this, and not have a solution to your problem, but I am not a programmer...
|
|
|  |
 |

jposwald
User
May 22, 2008, 3:34 PM
Post #8 of 28
(1499 views)
Shortcut
|
Thank you, drop down menu are CSS, dynamic. I hope Dave have the answer for my request. Best Regards, Juan.
|
|
|  |
 |

Dave
Staff
/ Moderator

May 22, 2008, 5:13 PM
Post #9 of 28
(1494 views)
Shortcut
|
Hi Juan, It looks like the top search box is working but not the middle one. I think that's because in the search.php it's looking for a field named "q" and the top field is named "q" but the second one is named "q2". Can you rename the second one to "q" as well? Here's a working link: http://www.worldwidetrainings.com/Search.php?q=training Hope that helps! Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

jposwald
User
May 22, 2008, 11:12 PM
Post #10 of 28
(1491 views)
Shortcut
|
It only Search in footer_ array, could be because is there a limit to search arrays?
|
|
|  |
 |

Dave
Staff
/ Moderator

May 23, 2008, 8:42 AM
Post #11 of 28
(1473 views)
Shortcut
|
Juan, Thanks for the clarification. I checked again and see that problem. You only need this line once at the top: $searchTables = array(); leave the first one and remove all the rest and it will search all your tables. Hope that helps. Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

jposwald
User
May 23, 2008, 12:23 PM
Post #12 of 28
(1470 views)
Shortcut
|
Dave sorry but I don't understand, Do I have to delete as is?: <?php require_once "/home/content/w/w/t/wwtrainingsk2/html/cmsAdmin/lib/viewer_functions.php"; $searchOptions = array(); $searchOptions['keywords'] = @$FORM['q']; $searchOptions['perPage'] = "20"; $searchOptions['debugSql'] = "0"; $searchTables = array(); $searchTables['cursos_el_'] = array( 'viewerUrl' => 'EL_Listado_ver.php', 'titleField' => 'nombre', 'summaryField' => 'descripcion', 'searchFields' => array('nombre','descripcion'), ); $searchTables = array(); $searchTables['cursos_pr_'] = array( 'viewerUrl' => 'PR_Listado_ver.php', 'titleField' => 'nombre', 'summaryField' => 'descripcion', 'searchFields' => array('nombre','descripcion'), ); $searchTables = array(); $searchTables['cursos_en_'] = array( 'viewerUrl' => 'EN_Listado_ver.php', 'titleField' => 'nombre', 'summaryField' => 'descripcion', 'searchFields' => array('nombre','descripcion'), ); $searchTables = array(); $searchTables['soluciones_'] = array( 'viewerUrl' => 'Soluciones_ver.php', 'titleField' => 'id', 'summaryField' => 'descripcion', 'searchFields' => array('id','descripcion'), ); $searchTables = array(); $searchTables['certificaciones_'] = array( 'viewerUrl' => 'Certificaciones_ver.php', 'titleField' => 'nombre', 'summaryField' => 'descripcion', 'searchFields' => array('nombre','descripcion'), ); list($searchRows, $searchDetails) = searchMultipleTables($searchTables, $searchOptions); ?> And only put this?<?php require_once "/home/content/w/w/t/wwtrainingsk2/html/cmsAdmin/lib/viewer_functions.php"; $searchOptions = array(); $searchOptions['keywords'] = @$FORM['q']; $searchOptions['perPage'] = "20"; $searchOptions['debugSql'] = "0"; $searchTables = array(); list($searchRows, $searchDetails) = searchMultipleTables($searchTables, $searchOptions); ?>
|
|
|  |
 |

Dave
Staff
/ Moderator

May 23, 2008, 12:45 PM
Post #13 of 28
(1468 views)
Shortcut
|
You just need this line once: $searchTables = array(); not multiple times. I've removed all the others and updated it for you on your server. Make a backup of this file and have a look: http://www.worldwidetrainings.com/Search.php?q=training Hope that helps. Let me know if you have any more questions about that or need any more help! Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

jposwald
User
May 23, 2008, 5:48 PM
Post #14 of 28
(1460 views)
Shortcut
|
Yesss, great thank you Dave!!!
|
|
|  |
 |

jposwald
User
May 26, 2008, 12:08 PM
Post #15 of 28
(1348 views)
Shortcut
|
Dave, can I have dynamic links in Search.php? I mean make an if condition in each "viewer url" variable. Thank you!
|
|
|  |
 |

Dave
Staff
/ Moderator

May 26, 2008, 4:40 PM
Post #16 of 28
(1339 views)
Shortcut
|
No, because there's no extra fields to test (if I understand correctly). But another person is asking for that too so I'm going to see about adding it. If you could specify an extra field (extraField1) to load from each table would that be enough for you to do your if conditions and create dynamic links? Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

richo
Novice
May 27, 2008, 7:04 AM
Post #17 of 28
(1331 views)
Shortcut
|
I have the search working fine but if the data is listed say 10 per page, then when you go to the second page for example, the search says "Results page '2' not found, start over >>." Is there a way to stop this please? Thanks John
|
|
|  |
 |

Dave
Staff
/ Moderator

May 27, 2008, 9:30 AM
Post #18 of 28
(1325 views)
Shortcut
|
Hi John, It looks like that might be because you have two list viewers on the same page. One for search results and one for MP3s. So when you click "next" the the MP3's it puts &page=2 in the url and both viewers try to show page 2, even if it doesn't exist. One solution might be to put one of the list viewers (the MP3s) in an iframe. Would that work for you? Or you could split up the page some other way. Hope that helps! Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

richo
Novice
May 27, 2008, 12:34 PM
Post #19 of 28
(1318 views)
Shortcut
|
Thanks for the prompt reply. I will try that. Is there a way that the results can be displayed in the "whateverDetail.php" page as a list rather than individual links in the results page? Thanks again for your help. John
|
|
|  |
 |

Dave
Staff
/ Moderator

May 27, 2008, 2:55 PM
Post #20 of 28
(1310 views)
Shortcut
|
Yes, you should just be able to copy the list viewer over to the detail page. I'd start with that and see how it goes. You might need to add some extra code to the detail page if it's going to be paging through results though because by default it just loads the record number on the end of the url. See how far you can get with it and let me know when you need help. Hope that helps. Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

richo
Novice
May 28, 2008, 8:38 AM
Post #21 of 28
(1258 views)
Shortcut
|
I keep going round in circles so I hope you can help. The iframe does work but causes big problems when used either for the list or the search. Links, of course appear in the frame. Would you mind following this link to see what I am trying to do please? http://theatremusicshop.com/dlg/cart/mp3List.php I want to have the search on a separate page but when a search is made I want the results to show like the list is displayed now. At the moment when a search is made the results are shown below the search as links. I want them to appear with all the information as per the mp3List. Many thanks John
|
|
|  |
 |

Dave
Staff
/ Moderator

May 28, 2008, 3:02 PM
Post #22 of 28
(1233 views)
Shortcut
|
Hi John, You should be able to put the search form on any page you like with some code like this:
<form method="GET" action="/dlg/cart/mp3List.php" > <input type="text" name="q" value="" size="50"> <input type="submit" name="" value="Search"> </form> Will that do what you need? Let me know what else is missing. Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

richo
Novice
May 28, 2008, 3:37 PM
Post #23 of 28
(1230 views)
Shortcut
|
Thanks Dave but it's the way the results are displayed. I want them to display like the list of MP3s at the bottom of the page. That's what I can't get it to do. At the moment it gives a list of links to the details page as individual songs. I want a list as per the bottom of the page showing title, category, duration, key, etc Many thanks John
|
|
|  |
 |

Dave
Staff
/ Moderator

May 29, 2008, 8:46 AM
Post #24 of 28
(1190 views)
Shortcut
|
John, I understand. You're not going to be able to use multisearch for that. You can use a regular search for as per the docs here: http://www.interactivetools.com/docs/cmsbuilder/viewer_search.html Multisearch is for when you want to search multiple sections that have different fields. Do you have multiple sections with MP3s or just one? If you like you can email me CMS and FTP login details to dave@interactivetools.com (email don't post login details in forum) and I can take a look and give you some suggestions on the best setup. Hope that help! :) Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

richo
Novice
May 30, 2008, 3:00 AM
Post #25 of 28
(1182 views)
Shortcut
|
Thanks for that - I have some reading to do! Just a little extra - I want to upload files upto 8MB in size but get an error - to change the php.ini In cmsadmin i have changed the section editor to allow unlimited upload size. Got any suggestions. Thanks John
|
|
|  |
|