Exemple #1
0
<?php 
printHeader("Contact Information");
startSection();
?>
I can be contacted by e-mail at dirk@id3.org or on ICQ UIN 808 7113.
<P>
The ID3Lib mailing list is a general ID3Lib announcements list.  To subscribe to it, send an e-mail message to dirk@id3.org with ID3LibSub as the subject and the automatic newsletter software will add you to the list.  Same again but with ID3LibUnsub as the subject will remove you from the list.
<P>
When you subscribe, please include a brief message about why you are subscribing.  If you are writing software, tell me what you are writing and what platforms you will support.  If ID3Lib is lacking in a certain area, I can look to see who is doing what and can ask for advice and ideas from the appropriate people.
<?php 
endSection();
?>

<?php 
printHeader("Special Thanks and Credits");
startSection();
?>
I would like to extend my many thanks to the people who have contributed to the ID3Lib project.  The show of support has been tremendous.  I consider ID3Lib to be a very 'international' product, as contributions have come from almost literally every corner of the globe.  If I have missed you, please forgive my lapse of memory.
 
<UL>
<LI>Jean-loup Gailly and Mark Adler – for their great zlib compression library and for making it free.
<LI>Tord Jansson – for much help with teaching me how to make and use DLLs.
<LI>Slava Karpenko – for creating the MacOS static link libraries for the PowerPC and CodeWarrior.
<LI>Bob Kohn – for his advice, input and generally creating the ID3Lib licence agreement.
<LI>Eng-Keong Lee – for finding a few bugs and for extensively testing ID3Lib 2.xx.
<LI>James Lin – for his 'ID3v2 Programming Guidelines', and many helpful suggestions.
<LI>Michael Mutschler – for prompting me to write the Unicode support and for his input on the ID3Lib calling convention.
<LI>Martin Nilsson – for ID3v2, his support of the ID3Lib web page, for many, many suggestions, debates, pointers, URLs, documents and brightly coloured fish.
<LI>Chris Nunn – for the 3D animated ID3v2 logos which appear in the ID3Lib web page and in the distribution.
<LI>Lachlan Pitts – for general implementation ideas and his brief but helpful work on the up-coming genre tree.
<LI>Jukka Poikolainen – for prompting to implement error handling via the C++ exception handling mechanism instead of the old 2.xx-style of using an error handling function.  Also for compiling the Borland static link libraries and greatly helping with the DLL.
Exemple #2
0
            $lineArray['comment'] = substr($comment, 0, strlen($comment) - 4);
            $comment = '';
        }
        if ($line[0] === '[') {
            startSection($blockArray, $section, $lineArray, substr($line, 1, strlen($line) - 2));
            unset($lineArray);
            continue;
        }
        if ($line[0] === '#') {
            $comment .= $line . '<br>';
            continue;
        }
        $splode = explode('=', $line);
        $lineArray[$splode[0]] = $splode[1];
    }
    startSection($blockArray, $section, $lineArray, $line);
    $retval = buildHtml($blockArray, $orange);
    echo $retval;
    return;
}
function buildHtml($blockArray, $orange)
{
    $html = '';
    $id = $section = 0;
    foreach ($blockArray as $key => $subArray) {
        // Deal with header comments if there are any...
        if ($key === 'comment') {
            $html .= "<blockquote class=\"blockquote\"><p><span class=\"trash fa fa-trash hand\" aria-label=\"Delete Item\" title=\"Delete Item\"></span><br>{$subArray}</p><input type=\"hidden\" name=\"#{$id}_#comment\" value=\"" . htmlentities($subArray) . "\"></blockquote>";
            continue;
        } elseif (substr($key, 0, 5) === 'blank') {
            $html .= "<input type=\"hidden\" name=\"b{$id}_blank\" value=\"\">";
Exemple #3
0
 /**
  * function getQuizPage:
  * Retrieves the next page for the user.
  * Use this function from outside the class.
  * @param Integer $userId User ID.
  * @return String HTML for the next page.
  */
 public function getQuizPage($userId)
 {
     if ($this->checkQuizCompleted($userId)) {
         displayinfo('You seem to have completed this quiz already. You can only take this quiz once.');
         return '';
     }
     if ($this->quizRow['quiz_allowsectionrandomaccess']) {
         // if btnStartSection and hdnSectionId are set
         if (isset($_POST['btnStartSection']) && $this->isValidId($_POST['hdnSectionId']) && sectionBelongsToQuiz($this->quizId, $_POST['hdnSectionId'])) {
             $sectionId = intval($_POST['hdnSectionId']);
         } elseif (isset($_GET['sectionid']) && $this->isValidId($_GET['sectionid'])) {
             $sectionId = intval($_GET['sectionid']);
         }
         if (!isset($sectionId)) {
             return $this->getFrontPage($userId);
         }
         $attemptRow = getAttemptRow($this->quizId, $sectionId, $userId);
         $sectionStarted = $attemptRow ? true : false;
         $sectionCompleted = !is_null($attemptRow['quiz_submissiontime']);
         if (!$sectionStarted) {
             if (!isset($_POST['btnStartSection'])) {
                 displayerror('Error. You have not started this section yet. Please go to the quiz main page, and click on the Start Section button to view this section.');
                 return '';
             }
             if (!startSection($this->quizId, $sectionId, $userId)) {
                 return '';
             }
         } elseif ($sectionCompleted) {
             displayinfo("You have completed this section.");
             return '';
         }
         if (isset($_POST['btnSubmit'])) {
             if ($this->submitQuizPage($userId) === true) {
                 if ($this->markSectionCompleted($userId, $sectionId)) {
                     // This section has been completed. See if the quiz also got completed
                     if ($this->checkQuizCompleted($userId)) {
                         return $this->quizRow['quiz_submittext'];
                     } else {
                         displayinfo('You have completed this section. You can move to another section.');
                         return $this->getFrontPage($userId);
                     }
                 } else {
                     displayinfo('Your previous page was submitted successfully.');
                 }
             }
         }
         // TODO: Put in time check here
         if ($this->checkUserTimedOut($userId)) {
             displayerror(QUIZ_TIMEOUT_ERRORMSG);
             $this->forceQuizCompleted($userId);
             return '';
         } elseif ($this->checkUserTimedOut($userId, $sectionId)) {
             displayerror(QUIZ_SECTION_TIMEOUT_ERRORMSG);
             $this->forceQuizCompleted($userId, $sectionId);
             return '';
         }
         return $this->formatNextPage($userId, $sectionId);
     } else {
         // if quiz is already started, show next page
         // else, see if btnStartQuiz is set, if yes, mark quiz as started, and show next page
         // to mark a user's quiz as started, we insert one entry for each section in the quiz into user_attempts
         // to see if the user's quiz has been started, we see if there is a row in user_attempts with section id 1
         $minSectionId = getFirstSectionId($this->quizId);
         $attemptRow = getAttemptRow($this->quizId, $minSectionId, $userId);
         if (!$attemptRow) {
             if (!isset($_POST['btnStartQuiz'])) {
                 return $this->getFrontPage($userId);
             }
             // ok, btnStartQuiz was set, and the quiz wasn't started already,
             // start it by inserting a row for each section in the quiz into quiz_userattempts.
             $attemptQuery = "INSERT INTO `quiz_userattempts`(`page_modulecomponentid`, `quiz_sectionid`, `user_id`, `quiz_attemptstarttime`) " . "SELECT {$this->quizId}, `quiz_sectionid`, {$userId}, NOW() FROM `quiz_sections` WHERE `page_modulecomponentid` = '{$this->quizId}'";
             if (!mysql_query($attemptQuery)) {
                 displayerror('Database Error. Could not update quiz information.');
                 return '';
             }
         }
         if (isset($_POST['btnSubmit'])) {
             if ($this->submitQuizPage($userId) == true) {
                 if ($this->markSectionCompleted($userId, -1)) {
                     if ($this->checkQuizCompleted($userId)) {
                         return $this->quizRow['quiz_submittext'];
                     }
                 } else {
                     displayinfo('Your previous page was submitted successfully.');
                 }
             }
         }
         // TODO: Put in time check here
         if ($this->checkUserTimedOut($userId)) {
             displayerror(QUIZ_TIMEOUT_ERRORMSG);
             $this->forceQuizCompleted($userId);
             return '';
         }
         return $this->formatNextPage($userId);
     }
 }