MyBB Community Forums

Full Version: [Page Manager] Share your custom pages
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
Well I just installed this mod, and it says I don't access to the editing page.

So I go to the acp>configuration>page manager and I get this message:
Quote:Access Denied

* You do not have permission to access this part of the administration control panel.

What should I do?
(2011-01-20, 11:25 PM)Wolfy Wrote: [ -> ]Well I just installed this mod, and it says I don't access to the editing page.

So I go to the acp>configuration>page manager and I get this message:
Quote:Access Denied

* You do not have permission to access this part of the administration control panel.

What should I do?

You have to grant permissions to some of your other IDs (ACP > Users & Groups > Admin Permissions). Reference this post.
Is it possible to make a homepage, if so can someone show me how.

I've installed/activated the Page Manager and added the Usermap page. (I think; I just named it Usermap, URI = usermap, and just inserted the usermap.xml content and clicked Save.)

Where is the link to the resulting Usermap page? I don't see it anywhere. How do I get to the Usermap?

_____________

OK, I figured out that I wasn't supposed to just paste the entire usermap.xml file into the Page Manager editor. I used the Import feature and now I can get to the Usermap page and it is working.

However, I still see no link to the Usermap page anywhere, including the Who's Online page. (I have selected Yes for Show in "Who is Online"?) The only way I can get to the Usermap page is by entering the URL into the browser address input.

Suggestion: add a link to the Usermap page somewhere.
(2011-02-13, 12:10 AM)dawkcodave Wrote: [ -> ]However, I still see no link to the Usermap page anywhere, including the Who's Online page. (I have selected Yes for Show in "Who is Online"?) The only way I can get to the Usermap page is by entering the URL into the browser address input.

Suggestion: add a link to the Usermap page somewhere.

its easy to add a link - you need to put <a href="{$mybb->settings['bburl']}/misc.php?page=NAME OF PAGE">Page name</a> in your header.

Its already said earlier in the thread that as the developer does not know where you want to put this page, or what you will call it, he has left placing the link to the admins who use the plugin.

Hi guys. I'm quite new to PHP and I'm struggling for days now with something that should be easy/looks easy.... Hope you can help !

I have created a query (SQL is my specialism Smile), f.e. like this:
$lista = $db->query("
	SELECT u.username,u.avatar,u.displaygroup 
	FROM ".TABLE_PREFIX."users u");

Multiple rows should come out. I created a code to use this data. Currently I'm using this:
while($row = $db->fetch_array($lista))
  {
$users= "<tr>
<td class='trow1'>" . $row['username'] . "</td>
</tr>";
  }

I'm using $users later on in my script. The only problem is that only one (the first) record is displayed. How do I get multiple rows ?

Many many thanks in advance !
Try this as your query

{
$lista = $db->query("
    SELECT u.username,u.avatar,u.uid, u.displaygroup 
    FROM ".TABLE_PREFIX."users u");
	if ($db->num_rows($lista) > 0)
	{
	$listarows = "";	
while($lista = $db->fetch_array($lista))
		{
			$listarows .= '<tr>
			<td class="{$bgcolor}" align="left">'. build_profile_link($lista['username'], $lista['uid'], $lista['displaygroup']). '</td>
			<td class="trow1" align="center">'. $lista['avatar']. '</td>
			</tr>';
}
}

You say you are using $users later on in your script - if you change that to $lista it will work - alternatively, you can replace $lista with $users in the above code.


Sorting urls

Hi, I have successfully made a page to run a custom report, but I am trying to make the table columns sortable and failing quite miserably.

here is my code:
<?php

global $db, $mybb, $headerinclude, $header, $theme, $footer, $lang;
{
    switch($mybb->input['sortby'])
    {
        case "fussy":
            // Order by threadfield diet
            $sortfield = "td.diet";
            $sortby = "fussy";
            break;
        case "guest":
            // Order by guest uid
            $sortfield = "u.uid";
            $sortby = "guest";
            break;
   };
    // Figure out which sort order to use

switch($mybb->input['order'])
{
            case "desc":
            $sortorder = "DESC";
            $order = "desc";
            $alt_order = "asc";
            break;
        case "asc":
        default:
            $sortorder = "ASC";
            $order = "asc";
            $alt_order = "desc";

    };
    // From our URL, pick which heading to choose as our 'active' header
    // This provides a way for reversing the order in a URL
    if($mybb->input['sortby'])
    {
        $page_url .= "?sortby=".$sortby;
    }

    $orderarrow = array();
    $orderarrow[$sortby] = "[ <a href=\"".$page_url."&amp;order=".$alt_order."\">".$alt_order."</a> ]";

    if($mybb->input['order'])
    {
        $page_url .= "&amp;order=".$order;
    }

$lunchquery = $db->query("SELECT td.*, t.*, u.uid, u.usergroup, u.displaygroup, u.username AS username, uf.* FROM ".TABLE_PREFIX."threads t  LEFT JOIN ".TABLE_PREFIX."threadfields_data td ON (td.tid=t.tid) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid) LEFT JOIN ".TABLE_PREFIX."userfields uf ON (t.uid=uf.ufid) WHERE  td.lunch ='Yes'  ORDER BY {$sortfield} {$sortorder}
");

	if ($db->num_rows($lunchquery) > 0)
	{
	$lunchtablerows = "";

	while($lunch = $db->fetch_array($lunchquery))
		{
		        $lunchuser = get_user($lunch['uid']);

			$lunchtablerows .= '<tr>
			<td class="{$bgcolor}" align="left">'. build_profile_link($lunchuser['username'], $lunchuser['uid'], $lunchuser['displaygroup']). '</td>
			<td class="trow1" align="center">'. $lunch['fid4']. '</td>
			<td class="trow1" align="center">'. $lunch['lunchnum']. '</td>
			<td class="trow1" align="center">'. $lunch['diet']. '</td>
			<td class="trow1" align="center">'. $lunch['diettext']. '</td>
			</tr>';

}
}
else
{
			$lunchtablerows .=  '<tr><td class="trow1" colspan="5" align="center">No one is hungry</td></tr>';
		}


	

}
$template='<html>
<head>
<title>'.$pages['name'].'</title>
{$headerinclude}
</head>
<body>
{$header}
<table border="1" cellspacing="1" cellpadding="4" width="100%" class="tborder">
<tr><td class="thead" colspan="4"><strong>Number of Guests per Day part</strong></td></tr>
<tr>
<td class="tcat2" width="25%" align="center"><span class="smalltext"><strong># of Guests at the Ceremony</strong></span></td>
<td class="tcat2" width="25%" align="center"><span class="smalltext"><strong># of Guests at the Lunch</strong></span></td>
<td class="tcat2" width="25%" align="center"><span class="smalltext"><strong># of Guests at the Party</strong></span></td>
<td class="tcat2" width="25%" align="center"><span class="smalltext"><strong># of RSVPs Received</strong></span></td>
</tr>
{$rsvptablerows}
</table>
<br />
<br />
<table border="1" cellspacing="1" cellpadding="4" width="100%" class="tborder">
<tr><td class="thead" colspan="5"><strong>Lunch Detail</strong></td></tr>
<tr>
<td class="tcat2" width="20%" align="left"><span class="smalltext"><strong>Guest</strong></a></span></td>
<td class="tcat2" width="10%" align="center"><span class="smalltext"><strong>Invites</strong></span></td>
<td class="tcat2" width="10%" align="center"><span class="smalltext"><strong>Confirmed</strong></span></td>
<td class="tcat2" width="10%" align="left"><span class="smalltext"><strong><a href="misc.php?sortby=fussy&amp;order=asc">Fussy</a><br />{$orderarrow[\'fussy\']}</strong></span></td>
<td class="tcat2" width="50%" align="center"><span class="smalltext"><strong>Fussy Demands</strong></span></td>
</tr>
{$lunchtablerows}
</table>
{$footer}
</body>
</html>';

$template=str_replace("\'", "'", addslashes($template));

add_breadcrumb($pages['name']);

eval("\$page=\"".$template."\";");

output_page($page);

?>

The problem is that I get an SQL error when I load the page using the {$sortfield} {$sortorder} variables in the query. Can anyone advise how to fix?

Yea, I will make it admin only viewable etc yadda yadda, but first I want to get the sort running Smile

Thanks
BUMP - any chance of some help?
Hey

I found bug:

If I include iframe in page, eg.

<iframe src="http://forum.onepiecenakama.pl/chat"  frameborder="0" >
Error
</iframe>

then i don't see in http://FORUM.com/online.php (Who's Online page) this page, only i see "Forum One Piece Nakama! Main Index", but shoud be "Viewing My Custom Page".

Sorry to my bad english.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49