// if it's multientry and there's a xoopsUser, or the user has globalscope, or the user has groupscope and it's not a one-per-group form, and after all that, no entry has been requested, then show the list (note that anonymous users default to the form view...to provide them lists of their own entries....well you can't, but groupscope and globalscope will show them all entries by anons or by everyone) ..... unless there is an override in the URL that is meant to force the form itself to display .... iform is "interactive form", devised by Feratech.
     if ($defaultListScreen and !$formulize_masterUIOverride) {
         $basescreenObject = $screen_handler->get($defaultListScreen);
         $finalscreen_handler = xoops_getmodulehandler($basescreenObject->getVar('type') . 'Screen', 'formulize');
         $finalscreenObject = $finalscreen_handler->get($defaultListScreen);
         $frid = $finalscreenObject->getVar('frid');
         // this will only be included once, but we need to do it after the fid and frid for the current page load have been determined!!
         include_once XOOPS_ROOT_PATH . "/modules/formulize/include/readelements.php";
         $renderedFormulizeScreen = $finalscreenObject;
         $finalscreen_handler->render($finalscreenObject, $entry, $loadThisView);
     } else {
         // this will only be included once, but we need to do it after the fid and frid for the current page load have been determined!!
         include_once XOOPS_ROOT_PATH . "/modules/formulize/include/readelements.php";
         include_once XOOPS_ROOT_PATH . "/modules/formulize/include/entriesdisplay.php";
         // if it's a multi, or if a single and they have group or global scope
         displayEntries($fid);
     }
 } else {
     // otherwise, show the form
     if ($defaultFormScreen and !$formulize_masterUIOverride) {
         $basescreenObject = $screen_handler->get($defaultFormScreen);
         $finalscreen_handler = xoops_getmodulehandler($basescreenObject->getVar('type') . 'Screen', 'formulize');
         $finalscreenObject = $finalscreen_handler->get($defaultFormScreen);
         $frid = $finalscreenObject->getVar('frid');
         // this will only be included once, but we need to do it after the fid and frid for the current page load have been determined!!
         include_once XOOPS_ROOT_PATH . "/modules/formulize/include/readelements.php";
         $renderedFormulizeScreen = $finalscreenObject;
         $finalscreen_handler->render($finalscreenObject, $entry);
     } else {
         // this will only be included once, but we need to do it after the fid and frid for the current page load have been determined!!
         include_once XOOPS_ROOT_PATH . "/modules/formulize/include/readelements.php";
<?php

defined('_JEXEC') or die('Restricted access');
switch (JRequest::getVar('task')) {
    case 'edit':
        editEntry();
        break;
    case 'update':
        updateEntry();
        break;
    default:
        displayEntries();
        break;
}
function updateEntry()
{
    JToolBarHelper::title(JText::_('Update Guestbook Entry'), 'addedit.png');
    $db =& JFactory::getDBO();
    $fldMessage = "'" . $db->getEscaped(JRequest::getVar('message')) . "'";
    $fldLocation = "'" . $db->getEscaped(JRequest::getVar('location')) . "'";
    $fldID = "'" . $db->getEscaped(JRequest::getVar('id')) . "'";
    $insertFields = "UPDATE #__guestbook " . " SET message =" . $fldMessage . "," . " location=" . $fldLocation . " WHERE id = " . $fldID;
    $db->setQuery($insertFields, 0);
    $db->query();
    echo "<h3> Field updated! </h3>";
    echo "<a href ='index.php?option=com_guestbook'> Return to GuestBook List </a>";
}
function displayEntries()
{
    JToolBarHelper::title(JText::_('Guest Book Entries'), 'addedit.png');
    $db =& JFactory::getDBO();
Exemple #3
0
    } else {
        ?>
      <?php 
        if ($config['admin'] == true) {
            ?>
         <fb:explanation><fb:message>This is what the public normally sees (excluding this message), you can delete entries here if you'd like.</fb:message></fb:explanation>
      <?php 
        }
        ?>
   <?php 
    }
    ?>

   <?php 
    if (!isset($_GET['page'])) {
        $_GET['page'] = 0;
    }
    ?>
   <?php 
    $count = $db->getEntriesCount();
    ?>
   <?php 
    if ($_GET['page'] !== 0) {
        $pagination = '<a href="?tab=view&page=' . $_GET['page'] - 1 . '">Previous</a>';
    }
    ?>
 

   <?php 
    echo displayEntries($db->getEntries(0));
}