Welcome, Guest. Please login or register.
Did you miss your activation email?
May 23, 2012, 06:03:14 PM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155438 Posts in 21702 Topics by 7755 Members
Latest Member: Smacki
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Search Results Loop  (Read 1855 times)
cnwb

Offline Offline

Posts: 234



WWW
« on: July 28, 2008, 03:21:14 AM »

Under settings > Advanced options under Search Settings
Results Loop:
Code:
<tr style="background-color: #FFF;">
<td><b><a href="[LINK]">[TITLE]</a><b>[LINK]</td>

I know LINK is the url, and TITLE is the page name.

How do I get the URL to show
Example:
Code:
http://www.yourdomainname.com/
or
Code:
http://www.yourdomain.com/pages/home.php

if I just add [liNK] out of a href  it shows up like
Code:
http://www.yourdomainname.com/search/index.php?search_path=&string=HOME&match=all

I would like to remove
Code:
search/index.php?search_path=&string=HOME&match=all
after
Code:
http://www.yourdomainname.com/
Logged

BerndJM

Offline Offline

Posts: 1764



« Reply #1 on: July 28, 2008, 03:33:29 AM »

Hi John,

sorry, but I read your post for about 5 times, and I understand what you want to do, but I cannot understand why you want this.
Maybe, if you can give a little explanation, what you want to realize, to give a answer who is leading to your desired result ist much more easier ...

Regards Bernd
Logged

In theory, there is no difference between theory and practice. But, in practice, there is.
SourDough

Offline Offline

Posts: 47


WWW
« Reply #2 on: July 28, 2008, 04:33:46 PM »

Without knowing your reasons for wanting to do this, here is a suggestion.  Replace the default 'Results Loop' under 'Search Settings' with this:

Code:
<tr style="background-color: #F0F0F0;">
<td><a href="[LINK]" onMouseOver="window.status='http://www.yourdomainname.com'; return true;">[TITLE]</a></td>
<td align="right">[TEXT_LAST_UPDATED_BY] [DISPLAY_NAME] ([USERNAME]) [TEXT_ON] [DATE]</td>
</tr>
<tr><td colspan="2" style="text-align: justify; padding-bottom: 5px;">[DESCRIPTION]</td></tr>
<tr><td colspan="2" style="text-align: justify; padding-bottom: 10px;">[EXCERPT]</td></tr>

This will show nothing in the status bar on lateset FF and show whatever you type in window.status=' ' in latest IE. Opera still shows the URL. 

Of course, the URL will always be visible by viewing source or turning off javascript. 

Nick
Logged
cnwb

Offline Offline

Posts: 234



WWW
« Reply #3 on: July 28, 2008, 06:27:53 PM »

I guess the best way to explain is to show a diagram example as show below..
Logged

SourDough

Offline Offline

Posts: 47


WWW
« Reply #4 on: July 28, 2008, 08:53:45 PM »

***This is for WB 2.7, I'm not sure what changes would need to be made to 2.6.x***

If I understand correctly, you don't want to manipulate the link in the status bar, you want to print the (stripped) link below the excerpt?

If so, you need to change the file WB_PATH\search\search_modext.php. 

After line 255, create a new variable, $link2, or whatever you'd like, and set it equal to page_link($mod_page_link);

Then, down around line 281, where the $vars array is set, add a new item into the array,
Code:
[LINK2]
, don't forget the comma and apostraphes.

Then, the next line down, where the $values array is set, before $link, add your new variable, $link2.

Then, in your search settings in the admin area, add your new
Code:
[LINK2]
to the result loop. 

I've attached a search_modext.php that has these changes.

I tested this on a test site with very few addons installed, so I'm not sure that it will work in all cases. 

Hope this helps.

Nick

Edit:
Also, you can easily wrap this in an
Code:
<a href="[LINK2]">[LINK]</a>
in your result loop.  Not sure if you were looking to hyperlink this or not though.
« Last Edit: July 28, 2008, 09:00:18 PM by SourDough » Logged
cnwb

Offline Offline

Posts: 234



WWW
« Reply #5 on: July 29, 2008, 02:21:15 AM »

Thank you for this fix SourDough,

This is exactly what I was looking for it works great!!!!!

Logged

cnwb

Offline Offline

Posts: 234



WWW
« Reply #6 on: August 11, 2008, 09:01:56 PM »

Tested for almost 2 weeks and this works no issues so far

Thank You
Logged

SourDough

Offline Offline

Posts: 47


WWW
« Reply #7 on: August 12, 2008, 03:25:46 PM »

Glad to hear it.

Nick
Logged
Olli

Offline Offline

Posts: 290


« Reply #8 on: September 19, 2008, 02:21:13 PM »

hello guys,

this comes very close to what i am trying to do. unfortunately i am stuck a little.
here is my problem:

i have got a news pages which is the only page i want to use the search on. so i turned off the search ability on all other pages first.

i tweaked the news module a little to store an additional text line. please see here:


i called the textfield inside mod_news_posts "$posturl" inside the database.

now i would like to make the search result directly klickable to $posturl replacing the normal title in the searchlist.


can you help me to swap the internal $pagelink to my $posturl from the news pages?

thanks a lot!
Logged
thorn

Offline Offline

Posts: 980


WWW
« Reply #9 on: September 19, 2008, 03:13:00 PM »

Hello,


can you help me to swap the internal $pagelink to my $posturl from the news pages?


Try this:
in wb/modules/news/search.php, line 41, replace
Code:
SELECT p.post_id, p.title, p.content_short, p.content_long, p.link, p.posted_when, p.posted_by
with
Code:
SELECT p.post_id, p.title, p.content_short, p.content_long, p.posturl, p.posted_when, p.posted_by
that is replace p.link with p.posturl

Untested.

thorn.
Logged

Olli

Offline Offline

Posts: 290


« Reply #10 on: September 22, 2008, 10:19:27 AM »

oh i just found it. thanks for pointing me into the right direction thorn!!!

this needs to be changed too:

line 67 same file:
Code:
   'page_link' => $res['posturl'],
        'page_title' => $res['title'],


btw: turning on/off the search ability to different news-pages should work, right?

right now i have two different news pages and no matter what i set inside the page preferences the page will be searched and displayed inside the search results...

i guess i broke sth...  undecided
« Last Edit: September 22, 2008, 12:39:57 PM by Olli » Logged
thorn

Offline Offline

Posts: 980


WWW
« Reply #11 on: September 22, 2008, 06:05:52 PM »

Hello,

btw: turning on/off the search ability to different news-pages should work, right?

right now i have two different news pages and no matter what i set inside the page preferences the page will be searched and displayed inside the search results...

i guess i broke sth...  undecided

Have you made changes to wb/search/search.php?
Normally, the search-function won't touch a page which is set to searching: disabled in "Modify Page Settings".

thorn.
Logged

Olli

Offline Offline

Posts: 290


« Reply #12 on: September 23, 2008, 09:15:29 AM »

hi thron,

yes i made some little adjustments to it. but to find the error i copied over the original files again (including the search settings inside the database) and it still does not work...

thats strange isn't it?
Logged
thorn

Offline Offline

Posts: 980


WWW
« Reply #13 on: September 23, 2008, 06:20:17 PM »

Hello,

please check file search/search.php again.
It should read
Code: (search.php about line 339)
$sections_query = $database->query("
    SELECT s.section_id, s.page_id, s.module, s.publ_start, s.publ_end,
           p.page_title, p.menu_title, p.link, p.description, p.keywords, p.modified_when, p.modified_by,
           p.visibility, p.viewing_groups, p.viewing_users
    FROM $table_s AS s INNER JOIN $table_p AS p ON s.page_id = p.page_id
    WHERE s.module = '$module_name' AND p.visibility NOT IN ('none','deleted') AND p.searching = '1' $search_path_SQL
    ORDER BY s.page_id, s.position ASC
");

thorn.
Logged

Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!