Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#37 2008-08-12 03:47:26

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

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

#40 2008-10-01 03:43:55

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

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


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#41 2008-10-01 03:58:39

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: jmd_dashboard: Customizable dashboard

Does this work for you?

add_privs('jmd_dashboard', '1, 2, 3, 4, 5');

Offline

#42 2008-10-01 04:42:20

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: jmd_dashboard: Customizable dashboard

jm wrote:

Does this work for you?

add_privs('jmd_dashboard', '1, 2, 3, 4, 5');

Sure does, thanks!


My Plugins

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

#44 2009-10-12 16:06:12

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

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

#45 2010-04-03 18:19:04

robin746
Member
From: Ireland
Registered: 2007-09-22
Posts: 113
Website

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

#46 2010-04-05 11:34:40

robin746
Member
From: Ireland
Registered: 2007-09-22
Posts: 113
Website

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

#47 2010-07-13 04:33:18

Katalonian
Member
From: Baku, Azerbaijan
Registered: 2010-04-18
Posts: 219
Website

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

#48 2010-07-13 05:32:38

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

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

Board footer

Powered by FluxBB