HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Another Admin Center mod

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#1022 (In Topic #251)

Fan in action

Another Admin Center mod

Hoorah! It's done!

Updated: Forgot to add the ability to customise the time :lol: Fixed now ;)

Suffice it to say If I were to list all the changes in this version, you would end up in the middle of next week  :rolleyes:

The basics:
This now works almost completley by variables. Instead of numbers, words or what not, its variables. Come on. Say it. Variables Variables Variables :D

- The Bullet Images are now also variables. What does this mean? You simply have to edit one file one variable to change ALL the bullets! (ofcourse, there's actually 2 variables.. one for the "todo" and one for the "completed").

Code

$bullet_full  = "b_full.gif";
$bullet_empty  = "b_empty.gif";

This says to look for "b_full.gif" in the current theme folder. Which is obviously easy to change now  B)

- If you don't like to monitor gifts, fine. Want to have news items in the admin center but don't want the flagrant text? Fine. Just change the right variable and voilà B)

Code

$show_news  = "1"; // <= Show the news in every section.
$show_iotd   = "1"; // <= Show the IOTD in every section.
$show_poll  = "1"; // <= Show the Poll in every section.
$show_fotw   = "1"; // <= Show the FOTW in every section.
$show_flag   = "1"; // <= Show the Flagrant Text items in every section?

- Want to change the "Schedule" of the updates/todos but don't want to bother with uploading files after files? Well. I'm lazy too :P :D

Code

// "To-Do Variables" configuration
// (aka if above this number, not done)
// ------------------------------------
$todo_iotd  = "25"; // <= Hours >> If above, needs to be done..
$todo_poll     = "14"; // <= Days  >> If above, needs to be done..
$todo_news  = "14"; // <= Days  >> ......
$todo_fotw  = "7";  // <= Days  >> ......
$todo_alldone   = "0"; // <= This actually does squat at this point... :D
$todo_alltodo   = "0"; // <= Again, nothing done by this yet.

// Done automatically. "todo" - 1 hour/day (this shouldn't be touched...)
//---------------------------
$comp_iotd     = $todo_iotd - 1;
$comp_poll     = $todo_poll - 1;
$comp_fotw     = $todo_news - 1;
$comp_news     = $todo_fotw - 1;

Basicly: If IOTD hours is above or equal to $todo_iotd then it needs to be done.
$comp_iotd is for the "completed tasks" section…

As shown here:

Code

if (get_option("is_on_iotd")==1 && $show_iotd == 1)
{
   $date=get_query_value_null_ok("SELECT `Date` FROM `ocp_iotd` WHERE validated='1'");
   if (!isset($date)) $hours="(never)"; else $hours=round((time()-$date)/60/60);
   if ($hours>=$todo_iotd) echo "<IMG SRC='{$base_url}/themes/{$theme}/{$bullet_empty}'> <A HREF='".build_url(array("page"=>"iotd","type"=>"choose"),"admincenter")."'>Update IOTD</A> [$iotd_queue waiting]<br />";
   if ($hours<=$comp_iotd) $done_iotd=1;
}[CODE]


- How to configure it is also very simple. It's just like editing a .txt file such as sidebar.txt or quotes.txt via the admin cp.



You can download the attachement, a zip file containing 3 files.
- acpsettings.php > this is where all the variables are stored.
- acpconfig.php > makes it so that you can use this instead of uploading back and forth...
- start.php > the admincenter's start.php.

Upload all 3 files in /admincenter/custom/
make sure that acpsettings.php has a permission mask of 666 (all read and write, none execute).

Then to start using it, add this line to your admin menu:
[code]ACP Configuration = index.php?page=acpconfig

And now all you gotta do is customize it. By default everything is one. Also, be sure to change the source .txt file for the admin notes found at the bottom of acpconfig (actually acpsettings, like i said.. acpconfig is a text editor which points to the acpsettings.php file ;))

ocProducts :wub: :wub:

Click here to drop by my website!
Back to the top
 
Posted
Rating:
#1026
Avatar

Are you going to tell us what this does?


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#1032
Avatar

Or how to use it? My guess is that this is a "teaser" of how easy it will be to configure your next mod?

Back to the top
 
Posted
Rating:
#1034

Fan in action

Yup Yup :)

Was going to put that (and more) in start.php but im tinkering around with the 'require once' thing :)

It's almost done. I just gotta figgure out how to make something like the 'configuration' page in the admin center <_<

:)

ocProducts :wub: :wub:

Click here to drop by my website!
Back to the top
 
Posted
Rating:
#1064

Fan in action

Tada! :D (check first post)

B) B) B)

Edited: oh. forgot to mention. post bugs in this topic or on my forums at a brand new fancy site > http://forums.jediarchives.ca :)

ocProducts :wub: :wub:

Click here to drop by my website!
Back to the top
 
Posted
Rating:
#1108
phT
Avatar

Fan in training

Is this similiar to your first admincenter?
Back to the top
 
Posted
Rating:
#1110

Fan in action

It's almost exactly the same thing, except now its even easier to configure your stuff. every section can also be turned on or off :) (thru the variables, acpsettings.php which can be configured thru the admin center via the acpconfig link you need to put…)

Saves alot of time instead of logging into your ftp manager and uploading the file back and forth :lol: ;)

ocProducts :wub: :wub:

Click here to drop by my website!
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: