Jump to content

Daimler

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Daimler's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. can you please tell me how can i do that ? thanks
  2. Hi i got this error when a username try to upgrade Warning: Division by zero in ../public_html/components/PaymentSelection.cmp.php on line 156 On line 156 i have this: $Layout->assign('col_width', round(580 / count($type_plans)) ); If someone help me to fix or hide this i would be grateful Thank you
  3. http://anuntoferta.ro/usercheckout.php Here is my site I think there is a problem because the site is in romanian language. You must fallow and complete all that steps to get the error. you will filnd the errot at the last step. PS. you need to create an account to add free ads.
  4. The script i use is 68 classifieds and i dont know whats the problem with it
  5. well can i do something ? remember i am a beginner im not so good at php and stuffs thanks
  6. no a user told me he cant upload some pictures..i fix that problem and i found this error on some page and now i want to fix it or at less hide it if its possible. Thanks
  7. is there any way to hide that error?
  8. were can i find that line ? sorry i am a beginner
  9. Hi, i receive today a message from one of my users..i have a new kind of error on my website: Notice: Query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id=1' at line 1 SQL: UPDATE class_users SET WHERE id=1 in ../public_html/includes/classes/database/mysql.php on line 133 The line 133: ' SQL: '.$sql); The code: /** * Returns an instance of MySQLResult to fetch rows with * @param $sql string the database query to run * @return MySQLResult * @access public */ function query($sql) { if (!$queryResource=mysql_query($sql,$this->dbConn)) trigger_error ('Query failed: '.mysql_error($this->dbConn). ' SQL: '.$sql); $this->counter++; $mysql = new MySQLResult($this,$queryResource); return $mysql; } Please help Thanks
  10. Hi everyone, i was trying to create a little script for my blog but cant do that. What i want is this model with dropdown options: http://www.pasidedans.ro/inscrie-te-acum I want to replace my entire cod so i dont want to modify him.. Can you help me to create a contact form like this ? thanks !
  11. Like i sayd i am a beginner and sorry for your time: Here is line 435: if ( isset($post_data[$field_name]) && !empty($post_data[$field_name]) && trim($post_data[$field_name])) And here is the entire code: <?php abstract class SK_Form { /** * The name of a form extension class. * * @var string */ private $class; /** * The name of a form. * * @var string */ private $name; /** * An array of fields objets. * * @var array */ public $fields = array(); /** * Keeps a keys of fields type of hidden. * * @var array */ private $hidden_fields = array(); /** * Form actions. * * @var array */ private $actions = array(); /** * If you have more than one actions in a form during $this->setup() set this value to the name * of the action which must processed by default when the user presses "Enter" button. * * @var string */ protected $default_action = ''; /** * Form frontend data store. * This data sets up and most used by a frontend handler. * * @var array */ public $frontend_data = array(); /** * Form javascript frontend handler object. * * @var SK_FormFrontendHandler */ public $frontend_handler; /** * Constructor. * * @param string $form_name */ protected function __construct( $form_name ) { $this->name = $form_name; $this->class = get_class($this); } /** * Register a form fields and actions. */ abstract public function setup(); /** * Form JS prototype presentation. * * @return string scriptable object json */ public function js_prototype() { $field_list = array(); foreach ( $this->fields as $field_key => $field ) { $field_list[] = "\n\t\t$field_key: " . str_replace("\n", "\n\t\t", $field->js_presentation()); } $action_list = array(); foreach ( $this->actions as $action_name => $action ) { $action_list[] = "\n\t\t$action_name: " . str_replace("\n", "\n\t\t", $action->js_presentation()); } $default_action = (count($this->actions) == 1) ? $action_name : $this->default_action; return "{ name: '$this->name',\n\t fields: {".implode(',', $field_list)."\n\t}, actions: {".implode(',', $action_list)."\n\t}, default_action: '$default_action' }"; } /** * Register and setup a form field. * * @param string|SK_FormField $field */ protected function registerField( $field ) { if ( is_string($field) ) { $field_class = "field_$field"; $field = new $field_class; } if ( !is_a($field, 'SK_FormField') ) { throw new SK_FormException('$field is\'t an instance of SK_FormField', 0); } $field->setup($this); $field_key = $field->getName(); if ( isset($this->fields[$field_key]) ) { throw new SK_FormException( 'field with key name "'.$field_key.'" is already registered', SK_FormException::DUPLICATE_FIELD_KEY_ENTRY ); } $this->fields[$field_key] = $field; if ( is_a($field, 'fieldType_hidden') ) { $this->hidden_fields[] = $field_key; } } /** * Register an action for the form. * * @param string|SK_FormAction $action */ protected function registerAction( $action ) { if ( is_string($action) ) { $action = new $action; } if ( !is_a($action, 'SK_FormAction') ) { throw new SK_FormException('$action is not an instance of SK_FormAction', 0); } $action->setup($this); $action_name = $action->getName(); if ( isset($this->actions[$action_name]) ) { throw new SK_FormException( '"'.$action_name.'" action is already registered', SK_FormException::DUPLICATE_ACTION_ENTRY ); } $this->actions[$action_name] = $action; } public static function __set_state( array $params ) { $form_class = $params['class']; $form_name = $params['name']; unset($params['class'], $params['name']); $_this = new $form_class($form_name); foreach ( $params as $prop => $value ) $_this->$prop = $value; // js frontend handler is always afresh $_this->frontend_handler = new SK_FormFrontendHandler($form_class); return $_this; } /** * Get the name of a form. * * @return string */ public function getName() { return $this->name; } /** * Render a form start html. * * @param array $params * @return string html */ public function renderStart( array $params = null ) { $output = '<form id="'.$this->frontend_data['auto_id'].'" method="post" onsubmit="return false;">'; // rendering hidden fields foreach ( $this->hidden_fields as $field_key ) { $output .= "\n" . $this->fields[$field_key]->render(); } foreach ( $this->actions as $action ) { // registering confirmations requiring $confirm_msg = $action->getConfirmation(); if ( $confirm_msg ) { SK_Layout::frontend_handler()->registerLanguageValue($confirm_msg); } // registering required fileds messages $required_fields = $action->required_fields(); foreach ( $required_fields as $field_key ) { SK_Layout::frontend_handler()->registerLanguageValue( $this->getErrorKey($field_key, 'required') , "\$forms.$this->name.fields.$field_key.errors.required" ); } } return $output; } /** * Render a form field label html. * * @param array $params * @return string html */ public function renderFieldLabel( array $params ) { if ( isset($params['text']) ) { $text = $params['text']; // text as attribute from template SK_Layout::frontend_handler() ->assignLanguageValue($text , "\$forms.$this->name.fields.{$params['for']}" ); } else { // auto label try { $section = 'forms.'.$this->name.'.fields.'.$params['for']; $text = SK_Language::section($section)->text('label'); } catch ( SK_LanguageException $e ) { $section = 'forms._fields.'.$params['for']; $text = SK_Language::text("$section.label"); } SK_Layout::frontend_handler() ->registerLanguageValue("$section.label" , "\$forms.$this->name.fields.{$params['for']}" ); } return '<label>'.$text.'</label>'; // $params['for'] } /** * Render a form field html. * * @param array $params * @return string html */ public function renderField( array $params ) { $name = $params['name']; if ( isset($params['label']) ) { SK_Layout::frontend_handler() ->assignLanguageValue($params['label'] , "\$forms.$this->name.fields.$name" ); } if ( !isset($this->fields[$name]) ) { trigger_error(__CLASS__.'::'.__FUNCTION__.'() field "'. $name.'" is not defined in "'.$this->name.'" form' , E_USER_WARNING); return; } $html_output = $this->fields[$name]->render($params, $this); return <<<EOT $html_output <div id="{$this->frontend_data['auto_id']}-$name-container"></div> EOT; } /** * Render a custom input item. * * @param array $params */ public function renderInputItem( array $params ) { $name = $params['name']; if ( !isset($this->fields[$name]) ) { trigger_error(__CLASS__.'::'.__FUNCTION__.'() field "'. $name.'" is not defined in "'.$this->name.'" form' , E_USER_WARNING); return; } $_field = $this->fields[$name]; if ( !is_a($_field, 'fieldType_custom_set') ) { // TODO: trigger a more understandable error } return $this->fields[$name]->renderItem($params, $this); } /** * Render a form button html. * * @param array $params * @return string html */ public function renderButton( array $params ) { if ( !isset($this->actions[$params['action']]) ) { trigger_error(__CLASS__.'::'.__FUNCTION__.'() action "'. $params['action'].'" is not defined in "'.$this->form_name.'" form' , E_USER_WARNING); return; } $tabindex = ''; if (isset($params['tabindex']) && $params['tabindex'] = intval($params['tabindex'])) { $tabindex = 'tabindex="'.$params['tabindex'].'"'; } if (isset($params['label'])){ $label = $params['label']; } else{ try { $label_section = "forms.$this->name.actions"; $label = SK_Language::section($label_section)->text($params['action']); } catch ( SK_LanguageException $e ) { $label_addr = 'forms._actions.'.$params['action']; $label = SK_Language::text($label_addr); } } $class = ''; if (isset($params['class'])) { $class = 'class="' . trim($params['class']) . '"'; } $id = $this->frontend_data['auto_id'].'-'.$params['action'].'-button'; $type = (count($this->actions) == 1 || $params['action'] == $this->default_action) ? 'submit' : 'button'; return '<input '.$class.' id="'.$id.'" type="'.$type.'" value="'.$label.'" '.$tabindex.' />'; } /** * Get the reference to a form action object. * * @param string $action_name * @throws SK_FormException * @return SK_FormAction */ protected function getAction( $action_name ) { if ( !isset($this->actions[$action_name]) ) { throw new SK_FormException( 'unrecognized action "'.$action_name.'"', SK_FormException::UNRECOGNIZED_ACTION ); } return $this->actions[$action_name]; } /** * Get the reference to a form field object. * * @param string $field_name * @throws SK_FormException * @return SK_FormField */ public function getField( $field_name ) { if ( !isset($this->fields[$field_name]) ) { throw new SK_FormException( 'unrecognized field "'.$field_name.'"', SK_FormException::UNRECOGNIZED_FIELD ); } return $this->fields[$field_name]; } /** * Get auto id prefixed id value for a form html element. * * @param string $id_value * @return string */ final public function getTagAutoId( $id_value ) { return $this->frontend_data['auto_id'].'-'.$id_value; } /* --- Form Processing --- */ /** * Process the form. * * @param array $post_data * @param string $action_name */ public function process( array $post_data, $action_name, SK_FormResponse $response ) { $action = $this->getAction($action_name); $proccess_fields = $action->getProcessFields(); $form_data = array(); foreach ( $proccess_fields as $field_name => $required ) { $field = $this->getField($field_name); if ( isset($post_data[$field_name]) && !empty($post_data[$field_name]) && trim($post_data[$field_name])) { try { $field->setValue($post_data[$field_name]); $form_data[$field_name] = $field->getValue(); } catch ( SK_FormFieldValidationException $e ) { $err_msg = $this->getErrorMessage($field_name, $e->getErrorKey(), @$field->profile_field_id); $response->addError($err_msg, $field_name); } } elseif ( $required ) { $err_msg = $this->getErrorMessage($field_name, 'required'); $response->addError($err_msg, $field_name); } else { $form_data[$field_name] = null; } } $action->checkData($form_data, $response, $this); if ( !$response->hasErrors() ) { return $action->process($form_data, $response, $this); } } /** * Get auto error message on current language. * * @param string $field_name * @param string $error_key * @param integer $profile_field_id */ private function getErrorMessage( $field_name, $error_key, $profile_field_id = null ) { if ( isset($profile_field_id) ) { $profile_fields_section = 'profile_fields.error_msg'; $message = SK_Language::section($profile_fields_section)->text($profile_field_id); return $message; } try { $preferred_section = 'forms.'.$this->name.'.fields.'.$field_name.'.errors'; $message = SK_Language::section($preferred_section)->text($error_key); } catch ( SK_LanguageException $e ) { $default_section = 'forms._fields.'.$field_name.'.errors'; try { $message = SK_Language::section($default_section)->text($error_key); } catch (SK_LanguageException $e) { $default_section = 'forms._errors'; $message = SK_Language::section($default_section)->text($error_key); } } return $message; } private function getErrorKey( $field_name, $error_key ) { try { $section = 'forms.'.$this->name.'.fields.'.$field_name.'.errors'; SK_Language::section($section)->text($error_key); } catch ( SK_LanguageException $e0 ) { try { $section = 'forms._fields.'.$field_name.'.errors'; SK_Language::section($section)->text($error_key); } catch ( SK_LanguageException $e1 ) { $section = 'forms._errors'; SK_Language::section($section)->text($error_key); } } return "$section.$error_key"; } } class SK_FormException extends Exception { const DUPLICATE_FIELD_KEY_ENTRY = 1, DUPLICATE_ACTION_ENTRY = 2, UNRECOGNIZED_FIELD = 3, UNRECOGNIZED_ACTION = 4; }
  12. Hi everyone..2 days ago my administrator was upgraded the entire server services and now on my website some errors ocurred: Warning: trim() expects parameter 1 to be string, array given in /home/gayland/public_html/internals/API/Form.class.php on line 435 {errors: [["Field \"{$label}\" is required","captcha"],["Field \"{$label}\" is required","match_sex"],["Field \"{$label}\" is required","relationship"],["Field \"{$label}\" is required","location"],["Field \"{$label}\" is required","birthdate"]], data: null} Can anyone help me please? PS: im not so good at coding
  13. Uncaught exception with message: Invalid use of group function code: 1111 Trace: #0 /home/gayland/public_html/internals/Apps/MailBox.app.php(61): SK_MySQL::query('SELECT `m`.`mes...') #1 /home/gayland/public_html/components/MailboxConversationsList.cmp.php(39): app_MailBox::getProfileConversations('1', 'inbox', 1) #2 /home/gayland/public_html/member/mailbox.php(7): component_MailboxConversationsList->__construct() #3 {main} thrown in: /home/gayland/public_html/internals/API/MySQL.class.php on line 157 Here is the code of MySQL.class.php: I was trying to delete this: throw new SK_MySQL_Exception( mysql_error(self::$link_id), mysql_errno(self::$link_id), $query); but if i delete this i got another errors
  14. bh sure i dont understood you i am a beginner. thanks for being so pactient with me, but were can i see the correct constants? in the phpmyadmin tables ? or ?
  15. ah no..the script is installed separated. on localhost and on webserver
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.