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.
Not a member yet? Click here to register.
Forgot Password?

How to add a panel with your/my code?

Pinned Asked Modified Viewed 31,034 times
P
PolarFox
P
  • Veteran Member, joined since
  • Contributed 1,633 posts on the community forums.
  • Started 29 threads in the forums
  • Started this discussions
asked
Veteran Member

It's simply.

Also knows as: HTML Panel

[olist=1]replace panel code with this (see below)
insert your code instead "<!-- your HTML/JS code here -->"
change panel name[/olist]

Side panel (Sidebar) - left or right:
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]openside('Panel name');
?>

<!-- your HTML/JS code here -->

<?php
closeside();[/syntaxhighlighter]

Center panel - top or bottom:
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]opentable('Panel name');
?>

<!-- your HTML/JS code here -->

<?php
closetable();[/syntaxhighlighter]

See also:


Collapsible panel
use this code
openside('Panel',true);
[...]

instead of

Quote

openside('Panel');
[...]


Hidden panel by default:
openside('Panel',true,'off');
[...]


[ulist=square]Don't forget: you can't use this with opentable() function![/ulist]
Edited by PolarFox on 10-09-2013 15:58,
0 replies

23 posts

C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

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.
0 replies
— 1 year later —
S
Spatry
S
Spatry 10
  • Newbie, joined since
  • Contributed 4 posts on the community forums.
  • Started 1 thread in the forums
answered
Newbie

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,
0 replies
D
douwe_yntema
D
  • Senior Member, joined since
  • Contributed 667 posts on the community forums.
  • Started 57 threads in the forums
  • Answered 1 question
answered
Senior Member

What is exactly the problem?

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

PHPFusion 7.02.7.
0 replies
S
Spatry
S
Spatry 10
  • Newbie, joined since
  • Contributed 4 posts on the community forums.
  • Started 1 thread in the forums
answered
Newbie

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,
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 23 posts
  • Votes 0 votes
  • Topic users 11 members

11 participants

C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
C
C
Wènhòu ¬
  • Junior Member, joined since
  • Contributed 11 posts on the community forums.
  • Started 1 thread in the forums
N
N
NetriX 10
Need help? Having trouble?
» View our Documentation for guides, functions and more - including the Getting Started section!
» Attach Log Files and Screenshots when reporting issues
» My support days are usually Mon-Thurs. Send me a PM if urgent.
  • Senior Member, joined since
  • Contributed 566 posts on the community forums.
  • Started 93 threads in the forums
C
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
P
P
  • Veteran Member, joined since
  • Contributed 1,633 posts on the community forums.
  • Started 29 threads in the forums
  • Started this discussions
H
H
  • Senior Member, joined since
  • Contributed 262 posts on the community forums.
  • Started 28 threads in the forums
B
B
  • Member, joined since
  • Contributed 122 posts on the community forums.
  • Started 29 threads in the forums
B
B
I fold for team 52482. Do you fold?
My PHP-Fusion powered site: Unlimited Fan Fiction
  • Newbie, joined since
  • Contributed 9 posts on the community forums.
  • Started 1 thread in the forums
D
D
  • Senior Member, joined since
  • Contributed 667 posts on the community forums.
  • Started 57 threads in the forums
  • Answered 1 question
B
B
  • Newbie, joined since
  • Contributed 3 posts on the community forums.
  • Started 1 thread in the forums
S
S
Spatry 10
  • Newbie, joined since
  • Contributed 4 posts on the community forums.
  • Started 1 thread in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet