Category: PHP

Construct a variable name in PHP from a string and another variable

The “Shop” page of this site is a php page which displays an amazon a-store category and the second level tabs appropriate to that category, using a “node id”.

The html for the tabs is defined in an included page like this:

<?php
//-------------//
$tabs6= '<ul class="yui-navset bd">';
$tabs6.='<li class="first selected" id="tab6"><a href="shop.php?tab=6" >Web Development</a></li>';
$tabs6.='<li class="" id="tab180"><a href="shop.php?tab=180" >CSS</a></li>';
$tabs6.='<li class=" " id="tab183"><a href="shop.php?tab=183">Javascript</a></li>';
$tabs6.='<li class="last" id="tab181"><a href="shop.php?tab=181">DHTML</a></li>';
$tabs6.='</ul>';

$tabs180= '<ul class="yui-navset bd">';
$tabs180.='<li class="first " id="tab6"><a href="shop.php?tab=6" >Web Development</a></li>';
$tabs180.='<li class="selected" id="tab180"><a href="shop.php?tab=180" >CSS</a></li>';
$tabs180.='<li class=" " id="tab183"><a href="shop.php?tab=183">Javascript</a></li>';
$tabs183.='<li class="last" id="tab181"><a href="shop.php?tab=181">DHTML</a></li>';
$tabs180.='</ul>';

$tabs183= '<ul class="yui-navset bd">';
$tabs183.='<li class="first " id="tab6"><a href="shop.php?tab=6" >Web Development</a></li>';
$tabs183.='<li class="" id="tab180"><a href="shop.php?tab=180" >CSS</a></li>';
$tabs183.='<li class=" selected" id="tab183"><a href="shop.php?tab=183">Javascript</a></li>';
$tabs183.='<li class="last" id="tab181"><a href="shop.php?tab=181">DHTML</a></li>';
$tabs183.='</ul>';

?>
Continue reading

Fixing “Too many redirects” error in MediaWiki

I run a wiki for my ParrotCichlid.com fish fancier’s site, based on “MediaWiki.” It had been running fine, except for an increasing problem with spam, but one day it simply stopped working. Browsing to the site would result in the following error message:

Too many redirects occurred trying to open “http://parrotcichlid.com/book/index.php/Main_Page”. This might occur if you open a page that is redirected to open another page which then is redirected to open the original page.


(Click to enlarge image)

Continue reading

dotProject Recipe: changing the tab names and content

tabs.jpg

The Projects page comes with a set of tabs, based on a combination of the project status fields and whether or not a project is active or archived, and includes a Gannt chart tab.

We changed the values used for Project Status to

0|Not Defined 2|Pending Content 3|In Progress 4|In Review 5|Complete

(to do this use: System Admin: System Lookup Values:click edit icon next to ProjectStatus)

Continue reading

dotProject Recipe: add a “Complete this task” checkbox to todo list

completionCheckbox.jpg

To allow one-click completion of a task, we added a checkbox to each row of the task “to-do” lists in dotProject.

Usually I try to borrow functions from other places in the application and adapt them to the new location. In this case the completion function was borrowed from the “progress” drop-down menu, on the add-edit Task screen.

The check box submits the same values as if 100% were selected from the drop-down menu.

Continue reading

Customizing dotProject files

dotProject is the most promising open-source (and free) project management software that I’ve found so far.

There are many small changes that needed to be made to the dotProject interface in order for it to work for my team, though. Chief among them was that all projects be numbered. The “short name” field just wasn’t sufficient to uniquely identify projects. We use project numbers in our workflow, in documents, email, and file systems. The number needs to combine the month and year the project was started with a 4-digit unique number.

Continue reading