Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: jmd_dashboard: Customizable dashboard
If you have invalid TXP code in the dashboard form, then you might get a white page on some servers. Is that what you mean by “won’t load anymore?” Make sure you’re using 0.2 too.
Offline
#38 2008-08-12 11:43:59
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: jmd_dashboard: Customizable dashboard
JM
Howdy. One preg_blahblahblah
‘gotcha’ that can lead to blank pages is not checking for returned NULL (error) values. I only just found this out recently so I thought I’d better share it.
Doing things like…
return preg_replace($pattern, $matches[0][0] . $dashTab, $buffer);
…is dangerous. Try…
$tmp=preg_replace($pattern, $matches[0][0] . $dashTab, $buffer);
return (NULL === $tmp) ? $buffer : $tmp;
…or…
$tmp=preg_replace($pattern, $matches[0][0] . $dashTab, $buffer);
if( NULL !== $tmp ) $buffer = $tmp;
unset($tmp);
return $buffer;
…instead just to be safe. At least if the replace ever errors you won’t wipe the entire buffer.
— Steve
Offline
#39 2008-08-12 16:09:32
- Ruhh
- Member
- From: dakota dunes
- Registered: 2008-01-20
- Posts: 305
Re: jmd_dashboard: Customizable dashboard
Actually, not even close to a white page. Just won’t load as in won’t open Dashboard at all. Stays on current page while that browser loading.gif is ongoing. I don’t remember exactly what happened that lead to that problem. But I am guessing after I played around with changing the tab name.
<txp:Ruhh />
Offline
Re: jmd_dashboard: Customizable dashboard
Is there a way to allow other access levels to view the Dashboard? I tried adding add_privs('jmd_dashboard', 3);
but still get Restricted Area
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: jmd_dashboard: Customizable dashboard
Does this work for you?
add_privs('jmd_dashboard', '1, 2, 3, 4, 5');
Offline
Re: jmd_dashboard: Customizable dashboard
jm wrote:
Does this work for you?
add_privs('jmd_dashboard', '1, 2, 3, 4, 5');
Sure does, thanks!
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
#43 2009-02-25 13:45:09
- koobs
- Member
- Registered: 2008-11-25
- Posts: 27
Re: jmd_dashboard: Customizable dashboard
Hi, Could somebody please explain how I get the dashboard to show as top level menu item. When I log in I get the dashboard page but it’s under Extensions>jmd_dashboard.
All help appreciated – thanks
Offline
Re: jmd_dashboard: Customizable dashboard
With txp 4.2.0, go to advanced preferences subtab, and in default_event select jmd_dashboard. A little late, but it works.. :)
Offline
Re: jmd_dashboard: Customizable dashboard
I will clarify the last few messages, now I have got this working for myself. This is for an install on Textpattern 4.2.
To allow users of different privileges the rights to this plugin, you need to edit the first function in the plugin code. Put something like the following as the top line of that function. The second parameter is a string.
add_privs('jmd_dashboard', '1, 2, 3');
If you want to change where in the tabs the Dashboard shows up, you can edit the next line. Having the Dashboard under Extensions is generally not so useful, especially since most of my users do not have rights to see this. You can also change the menu option to read whatever you like. Like so:
register_tab('content', 'jmd_dashboard', 'Welcome');
Finally, to get this to be the first thing a user sees on login, you need to choose from the menu Admin > Preferences. Click on “Advanced” and look in the “Admin” section. Change “Default admin tab” to be your Dashboard.
Last edited by robin746 (2010-04-03 18:19:28)
robin
Offline
Re: jmd_dashboard: Customizable dashboard
The help for this plugin has the following line in its form example:
<txp:article_custom form="jmd_dashboard_pending" status="pending"/>
However, article_custom does not work with status set to “pending”. Only for “live” and “sticky”. I have tested this.
Rather unfortunate, IMO. maybe someone with more skillz can tell me how to hack that tag to work as shown above.
P.S. Nice plugin!
Last edited by robin746 (2010-04-05 11:35:01)
robin
Offline
Re: jmd_dashboard: Customizable dashboard
how i can do that, when user login, open for every user different sections by default in write tab?
<txp:txp_me />
Offline
Re: jmd_dashboard: Customizable dashboard
Use rvm_privileged and some JavaScript in the jmd_dashboard form:
<txp:rvm_if_privileged name="user-a">
<script>window.location = "/textpattern/index.php?..."; // url to preselect an option</script>
</txp:rvm_if_privileged>
Obviously untested — you’ll need to fill in the blanks, but rvm_if_privileged can get you most of the way there. If you need to run JS per-user in the backend, you might want to look at jmd_admin_js as well (you’ll need to use rvm_privileged for loading as well).
Last edited by jm (2010-07-13 05:33:14)
Offline