11
zer0fill
xcGallery - What are intermediate pictures?
  • 2004/8/25 1:15

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


In xcGallery's preferences it has options for intermediate pictures. What is this?



12
zer0fill
Re: Template problem in 2.0.7.1
  • 2004/8/22 20:05

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


Try going to:
Blocks area (system > blocks)
Enable the Themes Block.
Go to your site and change the theme back to default
Hide the Themes block

Also tripple check which themes are selectable and the default (system > preferences > general)



13
zer0fill
Re: Class XoopsThemeForm
  • 2004/8/8 9:43

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


Thanks skalpa. For those who just can't wait, I've developed my own (simplistic) validation function

Source
/**           
* @author zer0fill, Sun Aug 08 02:34:28 PDT 2004       
* @desc Validates required input fields. Returns a preformatted string if there's an error     
* @return string|null        
* @param array $required (key=name / value=displayed error)         
*/ 
function validate($required)
{
    
// prep the error message, if any    
    
$message ='';
    
// setup a loop on each required field than doing it manually line by line    
    
foreach ($required as $key=>$item)
    {
      
// find the missing required fields (javascript disabled on user's end)
      
if (empty($_POST[$key])) {$message .= $item.', ';}
    }

    
// A missing field was detected
    
if (!empty($message))
    {
      
// setup the error message and remove the trailing `, `
      
$message '<div class="errorMsg">Missing Required Field(s): '.substr($message,0,-2).'</div>';
      return 
$message;
    }
}


Example
$required = array( 'office_id'=>'Office'
                      
,'role_id'=>'Role'
                      
,'type_id'=>'Type'
                      
,'title'=>'Title'
                      
,'fname'=>'First Name'
                      
,'lname'=>'Last Name'
                      
);
    
$errors validate($required);
    if (empty(
$errors))
    {
      
// save to db
    
}
    else
    {
      
$xoopsTpl->assign('errors',$errors);
    }


Output
<div class="errorMsg">Missing Required Field(s): OfficeRoleTypeTitleFirst NameLast Name</div>


BTW, did you also make regex checks like proper phone format inputs, email, at least x chars, etc (kinda like PEAR's $form->addRule()) ?



14
zer0fill
Re: XoopsForm - Is there a header element type?
  • 2004/8/8 6:04

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


Thanks Mr/s. Cat :)



15
zer0fill
Re: Class XoopsThemeForm
  • 2004/8/8 4:06

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


is there an option to do a server-side check than having us do our own validation?

ex
FROM
if (!empty($_POST['email']) && !empty($_POST['title']) && !empty($_POST['address']))
{
 
// save to db
}
else
{
 
$errors = array();
 if (empty(
$_POST['email']) {$errors[] = 'Missing Email<br />';}
 if (empty(
$_POST['title']) {$errors[] = 'Missing Title<br />';}
 if (empty(
$_POST['address']) {$errors[] = 'Missing Address<br />';}
 
$xoopsTpl->assign('errors',$errors);
}

TO
if ($form->validate($_POST)) // or $_GET wherever the data is coming from
{
 
// save to db
}
else
{
 
$xoopsTpl->assign('errors',$form->errors());
}


We would have all the form assignments (addElement()) at the top



16
zer0fill
XoopsForm - Is there a header element type?
  • 2004/8/8 3:39

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


Is there a XoopsForm element where I can separate sections by the header?

---------------------------------
         
Personal Settings
---------------------------------
First Name     | [[u]¯¯¯¯¯¯¯¯[/u]]
Last Name      | [[u]¯¯¯¯¯¯¯¯[/u]]
Street         | [[u]¯¯¯¯¯¯¯¯[/u]]
City           | [[u]¯¯¯¯¯¯¯¯[/u]]
State          | [[u]¯¯¯¯¯¯¯¯[/u]]
Zip            | [[u]¯¯¯¯¯¯¯¯[/u]]
---------------------------------
       
Contact Information  <--- another header in the same form
---------------------------------
AIM            | [[u]¯¯¯¯¯¯¯¯[/u]]
Email          | [[u]¯¯¯¯¯¯¯¯[/u]]

[
Submit]



17
zer0fill
Re: Update module template .html files from theme templates directory BUT for modules too?
  • 2004/8/2 1:43

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


Quote:

Stewdio wrote:
If it is set to yes, then all template files will be updated "automagicly".

Otherwise, deleting the named template file from /templates_c folder works like a charm.


Unless I'm doing something wrong, that option only works for the themes, not modules.

Wouldn't reloading (ctrl+r) the updated module be a lot faster than having to manually find which file to delete? click, delete, confirm.

Thanks for the suggestions all, but I was hoping for a truly transparent method of updating module template files (no manual updates or deletions)



18
zer0fill
Update module template .html files from theme templates directory BUT for modules too?
  • 2004/8/1 20:19

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


Is there an option somewhere to have XOOPS automatically load module template files like it can for themes? It's getting rather tedious having to update the module after every change done to the template.



19
zer0fill
XoopsForm - Inherited error checking? eg: phone, email, etc
  • 2004/7/10 6:57

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


Is there a built-in function for the XoopsForm to error check (javascript and php) user input such as phone numbers, email, custom? I think the PEAR form handler does this but not too sure if the XoopsForm is based off that.



20
zer0fill
*RESOLVED* XoopsThemeForm making elements side by side?
  • 2004/7/8 2:42

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


I remember being able to place two form elements next to each other on the same row but can't figure out how it was done. For example, I have a row with the telephone number and the extension.

I thought it was done by putting an array of elements in the $form->addElement(array($phone1_text,$phone1_ext_text), true); function but that didn't turn out too well.

--------------

Found it!

$phone1_tray= new XoopsFormElementTray('Phone 1');
$phone1_tray->addElement(new XoopsFormText(''"phone1"35100$_POST['phone1']));
$phone1_tray->addElement(new XoopsFormText('x'"phone1_ext"15100$_POST['phone1_ext']));




TopTop
« 1 (2) 3 4 5 ... 12 »



Login

Who's Online

235 user(s) are online (137 user(s) are browsing Support Forums)


Members: 0


Guests: 235


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits