PHP

Cannot Uninstall Old Moodle (1.x to 2.6) Themes (unsupported)

February 22, 2017
Cannot Uninstall Old Moodle (1.x to 2.6) Themes (unsupported)

Cannot delete old themes! (in moodle 2.8 and beyond) Cannot uninstall Disabled themes! We deleted the theme folders from the {moodle}/themes/ folder years ago but despite every attempt to "uninstall" them, they still show up in the plugins overview list. error: core_plugin/err_uninstalling_unknown_plugin Of course, you have to turn on error reporting to see this. If not, no error is displayed, moodle may just "hang"...

Read more »

PHP: Deleting Files

July 14, 2015

To delete all files of a particular extension, or in fact, delete a group with any wildcard, echo `rm -f path/to/*.jpg`; # note the backquotes, not single nor double quotes or foreach (glob("*.jpg") as $filename) { echo "$filename size " . filesize($filename) . "\n"; unlink($filename); } sometimes, the function realpath() may be needed: unlink(realpath($fileName)); or $mask = "*.jpg" array_map( "unlink", glob( $mask ) );...

Read more »

moodle 2 & 3: exclude my-moodle from admin

November 16, 2014

updated 2017-02-04 How to exclude admin, administrators, from the my-moodle dashboard The moodle Administrator is no longer excluded from the my-moodle module. Starting with moodle 2.0, if we activate the my-moodle front page for students, administrators get thrown into it also upon logging in. in ~/moodle199/index.php you could turn on "MyMoodle" for users and there was an exception for administrators, that exception has been...

Read more »

moodle database access functions

July 21, 2014

Access denied One of the dramatic proofs that OOP is NOT an improvement. In fact OOP programming is at least 3 times more expensive, time consuming, than structured programming. It is a step backward. If you try to use a standard php – mysql function call, you get "Access denied" these 2 database connection statements in your program enable bypassing moodle’s "Access denied" lock-out....

Read more »

TAKE jpg webcam PHOTO with HTML5

July 5, 2014
TAKE jpg webcam PHOTO with HTML5

updated 2016-03-03 How to take-upload your visitors webcam photo How to upload a jpg photo on your website with your visitors webcam html5 webcam getUserMedia examples and demo How to take a jpg webcam photo with html5 One of the really cool things that has come from HTML5 is the ability to access a website visitor’s webcam and upload a snapshot through the browser...

Read more »

moodle: A query to see where lessons come from

June 18, 2014

updated 2016-12-08 to see where-how the modules for each "Topic" are stored and kept in order SELECT cs.id, cs.course, cs.section, cs.sequence, cm.id AS cm_id, cm.module, cm.instance FROM mdl_course_sections AS cs JOIN mdl_course_modules AS cm ON FIND_IN_SET(cm.id, cs.sequence) WHERE cs.course = 40 AND cs.sequence '' AND cs.visible = 1 AND cm.visible = 1 ORDER BY cs.course, cs.section, FIND_IN_SET(cm.id, cs.sequence) ; look at your list of...

Read more »

how to add and edit reports in zencart

May 16, 2014

updated 2014-06-21 How To Create Your Own Reports in ZenCart I have done google searches on how to create my own reports in zencart and searches on how to edit the reports that are there and got no worthwhile information. There is a plugin zencart offers under "Admin Tools", called "Graphical Sales Report" and another simply called "Sales Report". They look helpful but are...

Read more »

Moodle: config.php, for debugging and flexible control

December 13, 2013

If you do not hard-code anything that is not necessary, you can avoid having multiple copies of files. If you have a test copy of moodle in a different folder (ex: mdl-test), add an if statement to handle it. if (stripos(dirname(__file__), 'mdl-test') ) {$CFG->dbname = 'mdl_backup'; } else {$CFG->dbname = 'mdl_production'; } I broke wwwroot up into 2 steps: $wwwroot = 'http://' . $_SERVER...

Read more »

Moodle: State required identity questions for on-line classes

November 24, 2013
Moodle: State required identity questions for on-line classes

U.S. State required security-identity questions for approval of online ‘certificated’ classes. State requirement for proof of identity while taking online classes State required proof of identity in an online classroom A few years ago, several states, including Nevada, Idaho, Florida and, N.Carolina, passed into law the additional, on-line education, requirement that "if a student can re-answer a set of personal questions asked at the...

Read more »

basic loops in PHP

February 10, 2013

Loops execute a block of code a specified number of times, or while a specified condition is true. for for ($i = 1; $i $mon) { echo $key . " – " . $mon . ""; } output: 0 – January 1 – February … 11 – December $characters = "Porky Pig"; $characters = "Daffy Duck"; $characters = "Speedy Gonzales"; foreach ($characters as $key...

Read more »

PHP INTRO, debugging, html quotes, closing tags, security

December 12, 2012

updated 2014-07-25 PHP is perhaps the most widely-used general-purpose scripting language*, especially suited for Web development. It is, in fact, the programming component of the "LAMP" environment: Linux, Apache, MySql, Php. PHP is surprisingly more popular than Microsoft’s own ASP web scripting language! PHP runs lot faster than ASP on MS Windows and has more features and functionalities than Microsoft ASP. PHP is much...

Read more »

moodle: Time Spent in a lesson, not being saved, preserved

October 29, 2012

updated 2017-02-04 Moodle: Time Spent in a lesson being falsified since mdl 2.3 Moodle: To require a minimum time spent in a lesson the time spent in a lesson was (years ago) preserved in a table that shows the time entering the lesson and the time leaving(finishing?) the lesson. Also, in the first page of a lesson, if a person refreshes the page, it...

Read more »

Delete the Zen-Cart Store Demo files, images, and Data

October 11, 2012
Delete the Zen-Cart Store Demo files, images, and Data

How to get rid of zen-carts demo store – including version 1.5.0. "How to clean up default install and remove example store related files." How to remove, or delete, the "Zen Cart demonstration categories and products". Help with installing Zen-cart, help removing Zen-cart’s demo store. How to Delete all the Zen-Cart Sample Store files, images, and Data. Install Zen-Cart and choose "NO" to the...

Read more »

make your Zen-Cart 1.5.0+ configuration.php files flexible

September 28, 2012

On you backup or testing server, for development, (not your live, commercial, site!!) you can create a fake SSL certificate (for free, of course!) officially called a "Self Signed Certificate" and operate with SSL turned on everywhere. Regardless! In your zen-cart configuration files, do not hard-code any settings that might be different on your backup or testing server or that you might want to...

Read more »

zen-cart v.150: cannot test off-site, "not accepting payments from your region"

September 25, 2012

"Sorry, we are not accepting payments from your region at this time" Problems with testing Zen-Cart 1.5.0 off-site updated Sept. 25th 2012 SSL certificate required for zen-cart on a development server? You’re kidding! I just started testing an upgrade (to v.150) on one of our development servers. I made sure it was working properly as is (v.138a in "test mode") before starting the upgrade...

Read more »