Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-07-01 16:33:59

sekhu
Member
Registered: 2005-05-12
Posts: 428
Website

Creating an admin side welcome page

Does anyone know how to do this? Basically what I want to do is create a page that

1) welcomes the user
2) lists the latest changes and updates to articles
3) last users to have access the site
4) is able to display admin-side pages only.

4) is the most important for me, and I’ll eplain this a bit. Basically I want to create admin side Flash tutorials on how to use the admin area of TXP, hwo to write articles, how to add images, how to use img popper – these would be availabe as links on the front admin welcome page – clicking the link either

a) redirects to another admin only page with a list of the tutorials on the left and small flash window int eh center with controls
b) opens in a smaller window for the tutorial like a pop up

I’ve been eager for to create some sort of group/panel or message board and tutorials on the admin side to help users learn to use TXP quickly rather than go through the textbook method. Least administrative effort.

Hope someoen can help. Perhaps TXP could use a few flash tuts on how to use TXP? Just a thought. This may help:

http://www.softpedia.com/get/Internet/WEB-Design/Flash/Wink.shtml

Last edited by sekhu (2005-07-01 16:34:30)

Offline

#2 2005-07-01 17:08:38

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: Creating an admin side welcome page

sekhu wrote:
I’ve been eager for to create some sort of group/panel or message board and tutorials on the admin side to help users learn to use TXP quickly rather than go through the textbook method. Least administrative effort.

I wanted to do this (add content to the backend to help the users) but no, I don’t think is is possible now (and yes, this is much missed). Or you will have to hack the php code, adding your content the hard-coded way.

Admin-side plugin can do some things, but it’s very heavy on the javascript :(

Offline

#3 2005-07-01 18:01:07

sekhu
Member
Registered: 2005-05-12
Posts: 428
Website

Re: Creating an admin side welcome page

so there’s no way? That’s…disappointing, I guess. All this modern technology.

Ok so tell me about this javascript side of it – I know a few people fluen tin JS and other scripting and programming languages, how could I get them to create something, or could they do it without being familiar with TXP? They might be able to help me out, it all depends on a few things. They’e helped out before with scripts.

Cheers

Offline

#4 2005-07-01 19:28:55

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Creating an admin side welcome page

Oh, yes you can do it with an admin-side plugin. Here is the main code:

<notextile><pre> if (@txpinterface == ‘admin’) { register_callback(“asy_showwelcome”, “article”, null , 1); }

function asy_showwelcome($event, $step) {

if ( !(empty($_GET) && empty($_POST)) ) return; pagetop(“Textpattern”,’‘); echo “<div>“I’m sorry Dave, I’m afraid I can’t do that.</div>”; exit; }
</pre></notextile>

Explanation:
We register a callback for the article-event, for every step (null) that should be executed before the txp_article page (we pass a 1 for $pre, the last option, which otherwise defaults to 0). Note: The Article page defaults to the “create” event, but only after txp_article is executed, before it is just undefined.

In the callback-function itself, we check wether GET as well as POST is both empty, that means the person is on the main page. When he later clicks on “write”, the GET-value for event will be set.
Then we output some html, you can do is anyway you like, either with echo, or do some query to get an article, or output a form etc. etc.

The exit; at the end is a bit drastic. It kills the execution of the rest of the script. This shouldn’t be a problem, I assume but I haven’t tested it. Alternatively leave the exit; away and the regular article-create page will be rendered underneath. And a more elegant solution, is to use output-buffering to let the rest of the page execute, but hide the output. So you call ob_start(‘asy_myfunkyhandler’); where now the exit is. And you also define a function as follows:
<notextile><pre>
function asy_myfunkyhandler($buffer)
{ // we just return nothing. <evil laughter> return ‘’;
}
</pre></notextile>

Have fun.

Offline

#5 2005-07-01 19:44:29

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Creating an admin side welcome page

You can do this, as in, it is possible. JavaScript doesn’t come into it. It will require quite some work though, and you’ll (or whomever does this) need strong php and mysql skills.

Not a message board if you mean like this forum. There already exists a hack and mod if you mean a little place to hold notes.

The one thing difficult to achieve would be making it the ‘startup’ page, since the login form doesn’t pass event information. If it did, defining a startup page would just require a little trickery. If you don’t supply a $step, Textpattern assumes you want the write tab after login. All you’d need to do is append ?step=your_plugin_tab for the admin bookmark, and you’re all set. I’m going to submit a patch to allow this, and hopefully it will get added, since its such a small amount of code, but a nice convenience.

Offline

#6 2005-07-01 20:31:58

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Creating an admin side welcome page

> The one thing difficult to achieve would be making it the ‘startup’ page, since the login form
> doesn’t pass event information.

Hi mary,

theoretically you are right. Practically it can be quite easily achieved, see my example code above. It is not really login-dependant, but it is the first page one sees.

Offline

#7 2005-07-01 20:38:27

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Creating an admin side welcome page

I had started typing my response and sent it before seeing yours. I’m an admitted multi-tab-er. ;) Usually I check again before sending, but neglected to do that this time. :)

Your method does work, there’s nothing really “wrong” with it, and can and should be used in the interim. The only drawback is that it is a little more work for something that should be more simple for this situation, in my opinion. Defining a different start page for any reason should and can be much easier. Like, for those who are image bloggers, they’d probably love heading right to the images tab to upload, rather than having to click an extra time. Perceived ease of use is sometimes everything. ;)

The patch I spoke of consists of one line added to txp_auth.php:
(gps('event') ? eInput(gps('event')) : '').

All of the sudden you can bookmark any tab, built-in or plugins, and make it the first place you go when you login.

Offline

#8 2005-07-01 20:57:58

sekhu
Member
Registered: 2005-05-12
Posts: 428
Website

Re: Creating an admin side welcome page

wow – well thanks for the response sencer and mary but it’s well over my head, i can’t even tell if it’s js or php but I’ll see if someone else can take a look at it and figure it out and perhaps can help me make something out of it.

cheers

Offline

#9 2005-07-01 21:13:54

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Creating an admin side welcome page

@mary: ah, ok, multi-tab. I like your suggestion. Though I use bookmarks and bookmarklets anyway. :)

@sekhu: my example only shows how to “hijack” the front-admin page. Everything else is, like mary says, quite a bit of work, and should be done by someone who knows a bit of mysql+php and textpattern-code (the last will make it a lot easier).

Offline

#10 2005-07-01 21:46:35

sekhu
Member
Registered: 2005-05-12
Posts: 428
Website

Re: Creating an admin side welcome page

would either of you know if 1.0 will feature a basic version of something like this – or will this only be viable via a plugin solution? TXP allows the potential to use and manage multiple users, but it would nice to add some sort customisable page for multiple authors as an internal faq…perhaps it’s not in demand.

thanks for you help again

Offline

#11 2005-07-01 23:07:27

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: Creating an admin side welcome page

I guess the notepad admin plugin could be adapted to serve this purpose… just gotta get back to work on that thing.

Offline

#12 2005-07-02 19:52:14

blumie607
Member
Registered: 2004-03-08
Posts: 175
Website

Re: Creating an admin side welcome page

It sounds like you want something like WordPress’s dashboard.


bludrop studios .::. Creative Expression

Offline

Board footer

Powered by FluxBB