Ignore:
Timestamp:
Jan 16, 2013, 2:15:29 AM (11 years ago)
Author:
mistic100
Message:

impove display, add LiveValidation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/GuestBook/include/guestbook.inc.php

    r17717 r20181  
    11<?php
    22if (!defined('GUESTBOOK_PATH')) die('Hacking attempt!');
     3
     4global $user;
    35
    46include(GUESTBOOK_PATH . '/include/functions.inc.php');
     
    116118  include_once(GUESTBOOK_PATH.'include/functions_comment.inc.php');
    117119
    118   $comment_action = insert_user_comment_guestbook($comm, @$_POST['key'], $page['infos']);
     120  $comment_action = insert_user_comment_guestbook($comm, @$_POST['key']);
    119121
    120122  switch ($comment_action)
     
    303305    }
    304306  }
     307  if (is_classic_user())
     308  {
     309    $author = $user['username'];
     310    $email = $user['email'];
     311  }
     312  if (empty($conf['comments_email_mandatory'])) // < 2.5 compatibility
     313  {
     314    $conf['comments_email_mandatory'] = false;
     315  }
     316
    305317  $template->assign('comment_add',
    306318      array(
     
    308320        'KEY' => get_ephemeral_key(3),
    309321        'CONTENT' => $content,
    310         'SHOW_AUTHOR' => !is_classic_user(),
    311         'AUTHOR' => $author ,
    312         'WEBSITE' => $website ,
    313         'EMAIL' => $email ,
     322        'IS_LOGGED' => is_classic_user(),
     323        'AUTHOR' => $author,
     324        'WEBSITE' => $website,
     325        'EMAIL' => $email,
    314326        'ACTIVATE_RATING' => $conf['guestbook']['activate_rating'],
     327        'EMAIL_MANDATORY' => $conf['comments_email_mandatory'],
    315328      ));
    316329}
     
    319332$template->assign('GUESTBOOK_PATH', GUESTBOOK_PATH);
    320333
    321 $template->assign('clear_themes', array(
    322   'clear',
    323   'gally-minimalist',
    324   'hr_os',
    325   'hr_os_xl',
    326   'kardon',
    327   'montblancxl',
    328   'Naive',
    329   'OS_glass_clear',
    330   'p0w0',
    331   'Pure_autumn',
    332   'Pure_clear_blue',
    333   'Pure_sky',
    334   'Pure_tr_clear_blue',
    335   'simple-white',
    336   'VerticalWhite',
    337   ));
    338 
    339334$template->set_filename('index', dirname(__FILE__).'/../template/guestbook.tpl');
    340335
Note: See TracChangeset for help on using the changeset viewer.