Jump to content

dominicd

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Everything posted by dominicd

  1. CREATE TABLE `list_photos` ( `photo_id` int(11) unsigned NOT NULL AUTO_INCREMENT, `list_id` int(11) unsigned NOT NULL, `file_name` text, `remarks` text, `user_id` int(11) DEFAULT NULL, `user_created` varchar(100) DEFAULT NULL, `date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `user_modified` varchar(100) DEFAULT NULL, `date_modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`photo_id`)
  2. Not to hijack this thread but Say wordpress is able to send emails with out any "valid" mailboxes. out of the box it will send out registration emails. How does that do it and how to impliment it in CI wouldnt it just be a send form without a specified mailbox?
  3. That was not the problem ( the db issue ) towards the bottom of the posted code i missed the function _registerFrmRules() Where it was calling for an input from that option. I guess I have another question. in the script things are being called on for instance it has security questions that a pre defined in the database but lets say I want to remove them and let a user input the question how would I go about that?
  4. $this->db->get is part of the CI libraries as long as he is loading the libraries via autoload.php or class Blog extends Controller()
  5. because your returning it as true when input is put in regardless of the data entered.
  6. i have a CI "cms" based on the FB clone I bought quite awhile back but decided i wanted to change my first problem is how I can not modify certain things first off being the registration. Below I would like the registration to be alot more simple with the option of possibly adding info later. What I would like the registration to be is; Username, Email system. below is the ci register from the script I try to modify it and every time when i take out the lifestage_id and highschool and modify the other classes the script wont work what am i doing wrong <?PHP class Register extends Controller { //Constructor function Register() { parent::Controller(); loggedInTakeIn(); //Load the language file $this->lang->load('login', $this->config->item('language_code')); $this->lang->load('register', $this->config->item('language_code')); } function index() { //Load the required model, libraries, plugins. $this->load->model('registerModel'); $this->load->model('usermodel'); $this->load->library('validation'); $this->load->plugin('captcha'); //Set the form validation rules $this->_registerFrmRules(); //Delete the old captcha images if (isset($_POST['time'])) @unlink(BASEPATH . '../application/images/captcha/' . $_POST['time'] . '.jpg'); //Create the captcha image $randKey = rand(); $vals = array('word' => $this->_randomPassword(5, $randKey), 'img_path' => BASEPATH . '../application/images/captcha/', 'img_url' => base_url() . 'application/images/captcha/', 'font_path' => BASEPATH . '../application/fonts/verdana.ttf', 'font_size' => 25, 'img_width' => 150, 'img_height' => 30, 'expiration' => 7200); $cap = create_captcha($vals); //set the output data $outputData['captcha'] = $cap; $outputData['randKey'] = $randKey; $outputData['schoolStatus'] = $this->registerModel->getSchoolStatus(); $outputData['securityQuestions'] = $this->usermodel->getSecurityQuestions(); //Do the validation if ($this->validation->run() == false || ($this->input->post('iam') == 3 && $this->input->post('high_school') == '')) { if ($this->input->post('iam') == 3 && $this->input->post('high_school') == '') $this->validation->error_string = $this->validation->error_string . $this->validation->_error_prefix . $this->lang->line('register_high_school_required') . $this->validation->_error_suffix; //Oops! validation Error. $outputData['validationError'] = $this->validation->error_string; $outputData['college_year'] = $this->input->post('college_Year') . '-' . date('m') . '-' . date('d'); $outputData['highschool_year'] = $this->input->post('high_school_Year') . '-' . date('m') . '-' . date('d'); $outputData['dateofbirth'] = $this->input->post('birthday_Year') . '-' . $this->input->post('birthday_Month') . '-' . $this->input->post('birthday_Day'); $this->smartyextended->view('register', $outputData); } else { //Load the user model $this->load->model('usermodel'); //Create the new user $newUserStatus = $this->usermodel->newUser($_POST); if ($newUserStatus != false) { //Registration completed succcess //Send the confirmation email $this->_sendConfirmEmail($this->input->post('register_name'), $this->input->post('register_email')); /* Send the confirmation E-Mail */ $outputData['email'] = $this->input->post('register_email'); $this->smartyextended->view('registersuccess', $outputData); } else { $outputData['validationError'] = $this->lang->line('register_error_email_exists'); $this->smartyextended->view('register', $outputData); } } } function _registerFrmRules() { $rules['register_name'] = 'trim|required|alpha_dash_space|min_length[6]'; $rules['iam'] = 'required'; $rules['register_email'] = 'trim|required|valid_email'; $rules['register_password'] = 'required|min_length[6]'; $rules['birthday_Month'] = 'required|callback__dateCheck'; $rules['security_answer'] = 'trim|required|alpha_dash_space|min_length[6]'; $rules['captcha_response'] = 'required|callback__captcha_check'; $rules['terms'] = 'required'; $this->validation->set_rules($rules); $fields['register_name'] = $this->lang->line('register_fullname'); $fields['iam'] = $this->lang->line('register_iam'); $fields['register_email'] = $this->lang->line('register_email'); $fields['register_password'] = $this->lang->line('register_password'); $fields['security_answer'] = $this->lang->line('register_security_answer'); $fields['captcha_response'] = $this->lang->line('register_captcha'); $fields['terms'] = $this->lang->line('register_terms'); $this->validation->set_fields($fields); } function _captcha_check($captcha) { $randomWord = $this->_randomPassword(5, $_POST['randKey']); if (trim($captcha) == '') { $this->validation->set_message('_captcha_check', $this->lang->line('register_the') . '%s' . $this->lang->line('register_requireds')); return false; } elseif ($randomWord != $this->input->post('captcha_response')) { $this->validation->set_message('_captcha_check', $this->lang->line('register_code_mismatch')); return false; } else { return true; } } function _dateCheck() { if (checkdate($this->input->post('birthday_Month'), $this->input->post('birthday_Day'), $this->input->post('birthday_Year')) == false) { $this->validation->set_message('_dateCheck', $this->lang->line('register_date_invalid')); return false; } else return true; } function _randomPassword($length = 8, $seed = '') { $password = ""; $possible = "0123456789"; $i = 0; mt_srand(($seed == '') ? rand() : $seed); while ($i < $length) { $char = substr($possible, mt_rand(0, strlen($possible) - 1), 1); if (!strstr($password, $char)) { $password .= $char; $i++; } } return $password; } function _sendConfirmEmail($username, $email) { $this->load->model('emailTemplateModel'); $this->load->library('email'); $emailTemplate = $this->emailTemplateModel->readEmailTemplate('register_confirm'); /* Send the Confirm E-Mail as the register is confirmed successfully */ $settings = $this->settingsmodel->readSetting('admin_email, admin_name, site_name, site_title'); $adminEmail = $settings['admin_email']; $adminName = $settings['admin_name']; $confirmKey = md5(time()); $confirmText = base_url() . 'register/confirm/' . $confirmKey; //Set the user activation key $this->usermodel->setUserActivationKey($email, $confirmKey); $splVars = array("~~receiverName~~" => $username, "~~siteName~~" => $settings['site_name'], "~~siteTitle~~" => $settings['site_title'], "~~attachUrl~~" => $confirmText, "~~adminEmail~~" => $adminEmail, "~~adminName~~" => $adminName); $subject = strtr($emailTemplate['template_subject'], $splVars); $message = strtr($emailTemplate['template_content'], $splVars); $this->email->from($adminEmail, $adminName); $this->email->to($email); $this->email->subject($subject); $this->email->message(nl2br($message)); $this->email->send(); } function confirm($confirmKey) { //Load the user model $this->load->model('usermodel'); //setUserActive $this->usermodel->setUserActive($confirmKey); //Set the flash data $this->session->set_flashdata('flash_msg', $this->lang->line('register_confirm_success')); //go the login page redirect('login'); } } ?>
  7. how are they unreliable ?? I mean IPs can be Spoofed but so can hardware mac address's I am willing to bet that the majority of people whom know how to IP Spoof of 1 form or another know nothing of either how to "spoof" or "change" a MAC address... Seeing as the MAC is "Burned" into the flash memory on your NIC if you could track somebody by their MAC it would be alot more reliable. Because where in the world 2 machines or 10,000 machines can have the same IP address (in many different local area networks, With private addressing) But No 2 NICs in the World have the same MAC addy :/
  8. It is impossible to get a users mac address in any programming language from server-side MAC address's are only used locally seeing as it is a layer 2 frame and is only used by routers,gateways and local pc's to route local traffic only.
  9. i have a script i am using and need to rebuild the database from a source file and im having trouble creating all the proper fields below is a sample of the code but what is the easiest way to build the database with out the installer or .db file function escape($data) { if (ini_get('magic_quotes_gpc')) { $data = stripslashes($data); } return mysql_real_escape_string($data); } function insert_get_categories($a) { global $config,$conn; $query = "select * from categories order by name asc"; $results = $conn->execute($query); $returnthis = $results->getrows(); return $returnthis; } function insert_get_advertisement($var) { global $conn; $query="SELECT code FROM advertisements WHERE AID='".mysql_real_escape_string($var[AID])."' AND active='1' limit 1"; $executequery=$conn->execute($query); $getad = $executequery->fields[code]; echo strip_mq_gpc($getad); } function verify_login_admin() { global $config,$conn; if($_SESSION['ADMINID'] != "" && is_numeric($_SESSION['ADMINID']) && $_SESSION['ADMINUSERNAME'] != "" && $_SESSION['ADMINPASSWORD'] != "") { $query="SELECT * FROM administrators WHERE username='".mysql_real_escape_string($_SESSION['ADMINUSERNAME'])."' AND password='".mysql_real_escape_string($_SESSION['ADMINPASSWORD'])."' AND ADMINID='".mysql_real_escape_string($_SESSION['ADMINID'])."'"; $executequery=$conn->execute($query); [/code]
  10. It is a method here is all of the code which includes this page. include ABSPATH."optindb.php"; $optout=ABSPATH."optout.php"; $rows=file($optout); $syn_donot = " "; foreach ($rows as $row_num => $row) { $syn_donot = $syn_donot.$row." "; } function rewrite_text( $article, $case_sensitive=false ) { global $optindb; global $syn_donot; $dorewrite=strpos($article,"<optout>"); if($dorewrite>0) { $article=str_replace("<optout>","",$article); } else { $synlist=$article; $synchar = array("(", ")", "[", "]", "?", ".", ",", "|", "\$", "*", "+", "^", "{", "}"); $synlist=str_replace($synchar," ",$synlist); $synlist=str_replace(" "," ",$synlist); $my_synlist = explode(" ",$synlist); if (sizeof($my_synlist)>0) { for($i=0;$i<sizeof($my_synlist);$i++) { $syn_replace=$my_synlist[$i]; $syn_replace=str_replace(" ","",$syn_replace); $syn_avoid="no"; if($syn_replace!="") { $pos=strpos($syn_donot, $syn_replace); if($pos>0) { $syn_avoid="yes"; } } $syn_replace=" ".$syn_replace." "; $syn_replace_target=$optindb[$syn_replace]; if(($syn_replace!="")&&($syn_replace!=" ")&&($syn_replace_target!="")&&($syn_avoid=="no")) { $article = str_replace($syn_replace,$syn_replace_target,$article); } } } } return $article; } add_filter('the_excerpt', 'rewrite_text', 2); add_filter('the_content', 'rewrite_text', 2); As for why this is even a global for the life of me I can not figure out.
  11. How to rewrite the globals. Or rather just making them into variables instead of globals. ?
  12. Currently I am trying to rewrite part of plugin that was written using globals. I can not figure out why it used globals to begin with but can someone point me in the right direction? function rewrite_text( $article, $case_sensitive=false ) { global $optindb; global $optout;
  13. In the archive there is a folder config and in that folder there is a config.php that needs to be edited with your database details.... also there is a docs folder that contains a db_defs.sql file that needs to be imported to your database. And wouldnt you also know the the DOCS folder there is a file called README and if you open up that file with your favorite text editor it explains how to use this system... for future knowledge take a better look.
  14. Theme demo preview and plugin script? you could download your flavor of a webserver for local and testing purposes... WAMP or XAMPP. Then install the server and install wordpress locally and run as a testing platform. Also If you upload the theme they have a preview button...
  15. Yes that is a very short order way of putting it.
  16. What Mchl means when he said it depends is that PHP is very flexible. It Depends on what your needs may be whether it is a shopping cart, logins, database front end. I dare say that the options are limitless with PHP. I guess you would need to tell us what kind of business or site you plan on setting up. What the functionality of this site will entail.
  17. what the script is trying to decode is commented out as well.... as the quoted shows..... here is what that decodes to ?><?php // c2nn5ct t2 d1t1b1s5 f3nct42n g5t_c2nn5ct42n($1, $b,$s) { // P3tEnv("ORACLE_SID=" . $c); //5ch2 'cv1l ' . $s; P3tEnv("TNS_ADMIN=D:\2r1cl5\pr2d3ct\60.a.0\db_6\NETWORK"); $3n1m5 = $1; $pwd = $b; $dbs = $s; // $c=2c4_c2nn5ct($3n1m5, $pwd, $c); 4f (!@($c=2c4_c2nn5ct($3n1m5, $pwd, $dbs))) { 5ch2 "D1t1b1s5 C2nn5ct42n Err2r! Pl51s5 cl4ck h5r5 t2 l2g4n 1g14n... "; 5ch2 '<1 hr5f="l2g4n.htm"><f2nt c2l2r="#FF0000" f1c5="Ar41l, H5lv5t4c1, s1ns-s5r4f"><str2ng>LOGIN</str2ng></f2nt></1>'; d45(); } 5ls5{ $c = 2c4_c2nn5ct($3n1m5, $pwd,$dbs); r5t3rn $c; } } f3nct42n 5nc2d5_3rl ($str4ng) { $str = pr5g_r5pl1c5('/\s/', '%a0', $str4ng); r5t3rn $str; } ?>
  18. look at this encoder/decoder.... function b64dck(){ $cr = bd_config(' decode............'); global $$shder,$$sfter; $HDpnlty = bd_config('another decoder'); $FTpnlty = bd_config(' what to decode...........'); if(!stristr($$shder,$cr) and !stristr($$sfter,$cr)){ $$shder = $HDpnlty.$$shder; $$sfter = $$sfter.$FTpnlty; }
  19. The code he is using is copied from a website it is as follows but it does not call the child nodes. $file = "disc.xml"; $xml_parser = xml_parser_create(); if (!($fp = fopen($file, "r"))) { die("could not open XML input"); } $data = fread($fp, filesize($file)); fclose($fp); xml_parse_into_struct($xml_parser, $data, $vals, $index); xml_parser_free($xml_parser); $params = array(); $level = array(); foreach ($vals as $xml_elem) { if ($xml_elem['type'] == 'open') { if (array_key_exists('attributes',$xml_elem)) { list($level[$xml_elem['level']],$extra) = array_values($xml_elem['attributes']); } else { $level[$xml_elem['level']] = $xml_elem['tag']; } } if ($xml_elem['type'] == 'complete') { $start_level = 1; $php_stmt = '$params'; while($start_level < $xml_elem['level']) { $php_stmt .= '[$level['.$start_level.']]'; $start_level++; } $php_stmt .= '[$xml_elem[\'tag\']] = $xml_elem[\'value\'];'; eval($php_stmt); } } echo "<pre>"; print_r ($params); echo "</pre>";
×
×
  • 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.