1
sarahmx
$xoops_requesturi help
  • 2007/12/23 18:51

  • sarahmx

  • Quite a regular

  • Posts: 381

  • Since: 2007/10/28


<{if $xoops_requesturi == "search.php"}>

<
link rel="stylesheet" type="text/css" media="screen" href="<{$xoops_url}>/themes/default/search.css" />

<{else}>

<
link rel="stylesheet" type="text/css" media="screen" href="<{$xoops_url}>/themes/default/style.css" />
<{/if}>



i'm trying to design my search.php..i use the if statement
above...it works

but in search result url example http://mysite.net/search.php?query=xo ... f47e02702ef8a6177619e72f2

it use the default style.css and not the search.css


how can i make search.php and the search result use the same style (search.css)

2
Catzwolf
Re: $xoops_requesturi help
  • 2007/12/23 19:01

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


My you are going about this the wrong way! Why don't you use xoTheme to add the CSS file into the header instead. You can directly edit search.php and add something like $xoTheme->addStylesheet('search.css');

Change this code about line 96:
if ($action == 'search') {
include 
XOOPS_ROOT_PATH.'/header.php';
include 
'include/searchform.php';
$search_form->display();
include 
XOOPS_ROOT_PATH.'/footer.php';
exit();
}


Change to this:
if ($action == 'search') {
    include 
XOOPS_ROOT_PATH.'/header.php';
    
$xoTheme->addStylesheet('search.css');
    include 
'include/searchform.php';
    
$search_form->display();
    include 
XOOPS_ROOT_PATH.'/footer.php';
    exit();
}


Change this code about line 146:

include XOOPS_ROOT_PATH."/header.php";
echo 
"<h3>"._SR_SEARCHRESULTS."</h3>n";
echo 
_SR_KEYWORDS.':';


Change to:
include XOOPS_ROOT_PATH."/header.php";
$xoTheme->addStylesheet('search.css');
echo 
"<h3>"._SR_SEARCHRESULTS."</h3>n";
echo 
_SR_KEYWORDS.':';


again at line 206 (ish)

case "showall":
case 
'showallbyuser':
include 
XOOPS_ROOT_PATH."/header.php";
$xoTheme->addStylesheet('search.css');
$module_handler =& xoops_gethandler('module');


Let me know that it works for you?

3
sarahmx
Re: $xoops_requesturi help
  • 2007/12/23 19:34

  • sarahmx

  • Quite a regular

  • Posts: 381

  • Since: 2007/10/28


the code i provided in my first post ..i put it in theme.html..now i know the method is wrong..

i'm so embarrassed

thank you catzwolf...for the help..

ive tried your method but it is not working

fyi i put the search.css in xoopsroot/themes/default/ folder


i'm using 2.0171

4
Catzwolf
Re: $xoops_requesturi help
  • 2007/12/23 21:49

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


lol no need to be embarrassed at all :)

ok, change all the lines:
$xoTheme->addStylesheet('search.css');

To the following:
$xoTheme->addStylesheet('/theme/'.$xoopsConfig['theme_set'].'/search.css');

And it should work :)

5
sarahmx
Re: $xoops_requesturi help
  • 2007/12/24 1:52

  • sarahmx

  • Quite a regular

  • Posts: 381

  • Since: 2007/10/28


thanks catwolf

$xoTheme->addStylesheet('/theme/'.$xoopsConfig['theme_set'].'/search.css');


there is a typo- theme should be themes..

that works

but now i have two style sheet in search.php

style.css and search.css

the search.php is using style.css

6
sarahmx
Re: $xoops_requesturi help
  • 2007/12/26 0:55

  • sarahmx

  • Quite a regular

  • Posts: 381

  • Since: 2007/10/28


Quote:

that works

but now i have two style sheet in search.php

style.css and search.css

the search.php is using style.css


bump

Login

Who's Online

49 user(s) are online (32 user(s) are browsing Support Forums)


Members: 0


Guests: 49


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits