Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2007-09-23 23:45:13

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: Set default admin tab

jakob wrote:

Not sure I agree — it sure looks good but I think that’s about it. On that screenshot there are 13 identical looking buttons of which 3 are highlighted. So tell me, how do you know where you are, and what do you do next?

ehh thats not really the fault of the admin interface as it is my own doing. i added the dashboard tab myself but i can’t get it to recognize that its NOT on the write or content tab. i started this thread in order to get help with the dashboard tab issue but didn’t get a response so i kinda just left the whole thing.

The latest articles and comments are two functions in sencer’s plug-in. The rest you can style as you like. I guess steve has added some of the php functions used in the diagnostic tab, a php-date function and a link to logout.

yep pretty much! i also snipped some functions (total articles/total comments) from some now-defunct plugins that could be considered a basic starting point in adding what you want to show. just a tiny step ahead of sencers initial simple dashboard. i couldn’t think of anything else to add at the time.

jstubbs in my form i had:

<div id="dashboard">
<h1 class="dashb_username">Welcome,
	<txp:php>
		global $txp_user;
		echo " " . $txp_user . "!";
	</txp:php>
	<a href="index.php?logout=1">[logout]</a>
</h1>

<h3 class="dashb_date">
	<txp:php>
		echo date('D M d Y g:i A');
	</txp:php>
</h3>

<hr />
<p class="dashb_lastmod">Last Modified: 
	<txp:php>
		echo $GLOBALS['prefs']['lastmod'];
	</txp:php>
</p>

<p class="dashb_lastmod">You are running 
	<txp:php>
		echo "TXP " . $GLOBALS['prefs']['version'];
	</txp:php>
</p>

<h2 class="dashb_heading">Latest Articles</h2> (<txp:lam_post_count /> published entries in total)
<div class="dashb_list"><txp:lam_dabo_articles limit="5" /></div>

<h2 class="dashb_heading">Latest Comments</h2> (<txp:lam_comment_count /> comments in total)
<div class="dashb_list"><txp:lam_dabo_comments limit="5" /></div>
</div>

<div id="dashb_footer">
<img src="<txp:site_url />textpattern/txp_img/carver.gif"/> <a href="http://textbook.textpattern.net/">Textbook</a> - <a href="http://forum.textpattern.com/">Support Forums</a>
</div>

the last two tags (<txp:lam_post_count /> and <txp:lam_comment_count />)won’t work with the default asy_dashboard cause i added them myself. atm i’m not sure where i placed my own modified version of the plugin. either way for the accompanying css is just something basic like this (its rather bloated for the sake of clarification):

#dashboard {
	margin:25px auto;
	width:50%;
	padding:15px;
	border:3px solid #eee;
}

h1.dashb_username {
	display:inline;
	text-align:left;
	color:#00ccff;
}

h2.dashb_heading {display:inline;}

h3.dashb_date {text-align:right;}

p.dashb_lastmod {
	text-align:right;
	margin:0;
}

.dashb_list {margin:10px 0;}

#dashb_footer {text-align:center;}

Last edited by iblastoff (2007-09-23 23:52:14)

Offline

#14 2007-10-29 14:29:48

fuls
Member
Registered: 2005-11-16
Posts: 117
Website

Re: Set default admin tab

Can someone send me the files of smalltransport redesign…the download link on his site is not working.

Thanks!

Offline

#15 2007-12-09 14:44:14

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: Set default admin tab

iblastoff

would you mind sending me the files for the smalltransport admin interface? I, too, cannot download it from that site!

Last edited by net-carver (2007-12-09 14:45:30)


Steve

Offline

#16 2007-12-09 16:06:11

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Offline

#17 2007-12-09 16:20:16

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: Set default admin tab

iblastoff

Thank you!


Steve

Offline

#18 2007-12-10 09:21:50

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,634
GitHub Twitter

Re: Set default admin tab

Hi Steve!

Inspired from you, I’d made your kind of asy_dashboard screen splash without your extra functions (lam_*).
If somebody is interested, here is the code :

<div id="dashboard" style="width:500px;margin:0 auto">
<h1 class="dashb_username">Welcome,<txp:php>
global $txp_user;
echo " " . $txp_user . "!";</txp:php><a href="index.php?logout=1" title="Logout" style="float:right">[logout]</a></h1>
<h3 class="dashb_date"><txp:php>
echo "Today's date ", date('d M Y');</txp:php></h3>
<p>Positive thought of the day : <br /><txp:php>
$q = 'SELECT COUNT(*) FROM '.PFX.'positive_thoughts';
$rs1 = getThing($q);
$rand_num = rand(1, $rs1);
$rs2 = safe_column('thought', 'positive_thoughts', 'id='.$rand_num.'');
foreach($rs2 as $thought) {
echo "“<b>$thought</b>”</p>";
}
</txp:php>
<hr />
<p class="dashb_lastmod">Website Last Modification On <txp:php>
$timestamp = $GLOBALS['prefs']['lastmod']; echo date("d M Y à H:i", strtotime($timestamp));</txp:php><br /> 
You are currently using TXP version <txp:php>
echo $GLOBALS['prefs']['version'] ." ";</txp:php></p>
<hr />
<h2 class="dashb_heading">Last 6 Articles : <br />( <txp:php>
$limit = 6;
$where = "Status='4' order by posted desc limit 0,$limit";
$q = 'SELECT COUNT(*) FROM '.PFX.'textpattern WHERE '.$where;
$rs = getThing($q);
echo( ($rs ? $rs : '0') );
</txp:php> total published - and <txp:php>
$nbre = safe_rows('*', 'textpattern', 'Section = "blog"');
echo count($nbre);</txp:php> articles within your "Blog" pages)</h2>
<div class="dashb_list"><txp:asy_dabo_articles limit="5" /></div>
<hr />
<txp:php>
$nbre = safe_rows('*', 'textpattern', 'Status < 4');
$nbre = count($nbre);
if(!empty($nbre)) {
echo '<h2 class="dashb_heading"><a href="#nogo" title="Toggle/Show" onclick="toggleDisplay(\'draft\'); return false;">'.$nbre.' Non Published Articles</a> :</h2>';
echo "\r";
echo '<div class="dashb_list" id="draft" style="display:none">';
echo asy_dabo_articles(array('limit'=>99,'draft'=>1));
echo "</div>\r";
} else {
echo "<h2>You have any non published articles</h2>";
}
</txp:php>
<hr />
<h2 class="dashb_heading"><a href="#nogo" title="Toggle/Show" onclick="toggleDisplay('photos'); return false;">More Showing Articles</a>:</h2>
<div class="dashb_list" id="photos" style="display:none">
<txp:output_form form="most_viewed_articles" />
</div>
<hr />
<h2 class="dashb_heading">Comments to be validate ( <txp:php>
$limit = 10;
$where = "visible='0' limit 0,$limit";
$q = 'SELECT COUNT(*) FROM '.PFX.'txp_discuss WHERE '.$where;
$rs = getThing($q);
echo( ($rs ? ($rs == 1 ? $rs.' total comment' : $rs.' total comments') : 'No comments yet') );
</txp:php> ) :</h2>
<div class="dashb_list"><txp:asy_dabo_comments pending="1" limit="10" /></div>
<h2 class="dashb_heading">Your Last 6 Comments ( <txp:php>
$where = "visible='1'";
$q = 'SELECT COUNT(*) FROM '.PFX.'txp_discuss WHERE '.$where;
$rs = getThing($q);
echo( ($rs ? ($rs == 1 ? $rs.' total comment' : $rs.' total comments') : 'No Comments Yet') );
</txp:php> ) :</h2>
<div class="dashb_list"><txp:asy_dabo_comments limit="6" /></div>
<hr />
<div id="dashb_footer">
<p style="text-align:center"><a href="http://textbook.textpattern.net/" title="Go to TextBook" target="_blank">Textbook</a> - <a href="http://forum.textpattern.com/search.php?action=show_24h" title="Last 24h help forums treads" target="_blank">Support Forums</a></p>
</div> <!-- /dash_footer -->
</div> <!-- /dashbord -->

And here is my “most_viewed_articles” form :

<p><txp:php>
$limit = 15;
$link = safe_rows('ID,Title, url_title, request_count', 'textpattern', "request_count order by request_count desc limit 0,".$limit);
foreach($link as $id => $valeur) {
echo "<a href=\"".hu."textpattern/index.php?event=article&amp;step=edit&amp;ID=".$link[$id][ID]."\" title=\"Go to write tab for this article\">".$link[$id][Title]." (shown ".$link[$id][request_count]." times)</a><br />\r";
}
</txp:php></p>

Obviously, you need rsx_request_count plugin by Ramanan Sivaranjan.

Cheers,

Last edited by Pat64 (2007-12-10 20:15:43)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#19 2007-12-11 05:42:05

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: Set default admin tab

All

just posted my first effort using the dashboard plugin in this thread.

Iblastoff

It’s not too difficult to stop the Content and Write tabs being highlighted by default. Just do $event = 'your_dashboard_event'; before the dashboard plugin code starts rendering pagetop().


Steve

Offline

#20 2008-02-22 12:03:30

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: Set default admin tab

marios wrote:

This will make the articles page load on default index.php request.

Thanks Marios,
I just came across this – perfect!

Offline

Board footer

Powered by FluxBB