Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.
Forgot Password?
Navigation

How to add a panel with your/my code?

Last updated on 10 years ago
C
ChanSuper Admin
Posted 12 years ago
go to includes/multisite.php - include in the code.

Quote

define("SCORE", DB_PREFIX."scores_0"wink;



Now, use ".SCORE." to represent your connection to the new addition of the table.

so your query will be...

Quote


$result = dbquery("SELECT * FROM ".SCORE." ORDER BY $scorea ASC"wink;
if (dbrows($result) !=="0"wink {

echo "<div>";
while ($data = dbarray($result)) {
echo "<p>".$row['ip']."</p>";
echo "....";
}

} else { echo "Did not find anything"; }


Do not need open or close. Our core does that automatically on end of the page.

P.S: Learn our documentation please. Check the syntax we build. It's very easy once you get to know them.
Lead Developer of PHP-Fusion
S
SpatryNewbie
Posted 10 years ago
This one has me stumped. I am trying to make a search panel which will search for ALL words, not ANY word. This is displaying on a custom page with instructions for using search within ARTICLES. (Articles and custom pages are the only features I am using) Here is the code for my panel:
    
    openside("my search");
    echo "<form id='searchform' name='searchform' method='get' action='".BASEDIR."search.php'>\n";
    echo "<input type='text' name='stext' value='".urldecode($_GET['stext'])."' class='textbox' style='width:875px' />\n";
    echo "<label><input type='hidden' name='stype' value='articles'".($_GET['stype'] == "news" ? " checked='checked'" : "")." onclick=\"display(this.value)\" /></label><br>\n";
    echo "<input type='submit' name='search' value='Search' class='button' /> &nbsp;<input type='reset' name='reset' value='Reset' class='button' />\n</form>\n";
    closeside();
    ?>

I am sure it is a simple line of code I am missing. What would be ideal is to have radio buttons on the search panel one for "Any word" and one for "All words". Any help in this matter would be greatly appreciated.
Edited by Spatry on 12-12-2014 13:14, 10 years ago
D
douwe_yntemaSenior Member
Posted 10 years ago
What is exactly the problem?

When I paste your code in an panel and enable it, the panel shows up.

PHPFusion 7.02.7.
S
SpatryNewbie
Posted 10 years ago
Correct... when I do a search it looks for ANY word. I want it to look for ALL words. Example:
A search for "Apples Oranges" will list results for all pages containing at least ONE of those words. I want my search panel to show results for pages which only contain BOTH words.

UPDATE: I figured out how to get what I wanted.

include LOCALE.LOCALESET."search.php";
openside("Distro Hub Search");
echo "<center><form id='searchform' name='searchform' method='get' action='".BASEDIR."search.php'>\n";
echo "<center><input type='text' name='stext' value='".urldecode($_GET['stext'])."' class='textbox' style='width:500px' />\n";
echo "<center><label><input type='hidden' name='method' value='AND'".($_GET['method'] == "articles" ? " checked='checked'" : "")." onclick=\"display(this.value)\" /></label><br>\n";
echo "<label><input type='hidden' name='stype' value='articles'".($_GET['stype'] == "articles" ? " checked='checked'" : "")." onclick=\"display(this.value)\" /></label><br>\n";
echo "<center><input type='submit' name='search' value='Search' class='button' /> &nbsp;<input type='reset' name='reset' value='Reset' class='button' />\n</form>\n";
closeside();
?>

Originally I added these lines:

echo "<label><input type='radio' name='method' value='OR'".($_GET['method'] == "OR" ? " checked='checked'" : "")." /> ".$locale['403']."</label><br />\n";
echo "<label><input type='radio' name='method' value='AND'".($_GET['method'] == "AND" ? " checked='checked'" : "")." /> ".$locale['404']."</label></td>\n";

but they messed up my panel appearance. The first set of code is working to my satisfaction so I am a happy camper.
Edited by Spatry on 12-12-2014 15:53, 10 years ago
You can view all discussion threads in this forum.
You cannot start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
You cannot set up a bounty in this discussion thread.
Moderator: Support Team