Jump to content

waldemar [pl]

Members
  • Posts

    31
  • Joined

  • Last visited

Contact Methods

Profile Information

  • Interests
    normal size :)
  • Activity
    Agency

Recent Profile Visitors

2,589,393 profile views

waldemar [pl]'s Achievements

Newbie

Newbie (1/14)

3

Reputation

  1. Darmowy moduł powiadomień o nowym zamówieniu przez komunikator Kadu/gadu-gadu. Dziś się trochę nudziłem i jest oto. Sposób użycia: Zarejestruj bota na https://boty.gg.pl/rejestracja/ W mailu który otrzymasz kliknij link weryfikacyjny. Wgraj plik weryfikacyjny na serwer, dokonaj weryfikacji i potwierdź utworzenie bota. W kolejnym mailu otrzymasz numer, login i hasło do bota. Wpisz je do odpowiednich pól modułu. Wpisz również numer GG odbiorcy na który będą przychodzić powiadomienia. Wyślij tekst ZAPISZ z numeru GG odbiorcy na numer swojego bota, dzięki temu bot będzie mógł wysyłać powiadomienia na numer GG odbiorcy. To wszystko. Życzę jak najwięcej powiadomień! notificationGG.zip licencja: thanksware.
  2. Fix for PS 1.4.x.x First make in /productcomments folder /mails. In /mails make folder with Your_iso_language like (en, fr, pl) and here mail templates named new_comment.(txt, html). Now you must in file productcomments on line 542 after $comment->save(); paste $template = 'new_comment'; $subject = $this->l('New comment'); $mail_ma = 'HERE_YOU_EMAIL_ADDRESS'; $id_lang = (is_object($cookie) AND isset($cookie->id_lang)) ? (int)$cookie->id_lang : (int)Configuration::get('PS_LANG_DEFAULT'); $iso = Language::getIsoById((int)$id_lang); if (file_exists(dirname(__FILE__).'/mails/'.$iso.'/'.$template.'.txt') AND file_exists(dirname(__FILE__).'/mails/'.$iso.'/'.$template.'.html')) Mail::Send($id_lang, $template, $subject, NULL, $mail_ma, NULL, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/');
  3. evolution.x: Thank You. I had the same problem as you. You helped me to solve it.
  4. Hello! The problem is in: open_basedir restriction in effect -> in this case, instead of trying to open the file index.php (like folder) and looking /mails. It is known that it will return an error and you have warning. Make a test and delete the moment index.php from /modules. Warning not be displayed. edit: sorry for my woodish english
  5. On OVH servers must change the line of mysql_close($order_res); on mysql_close();
  6. Hi, PS I have 1.2.4 and PWA module. I want to write a login module for facebook for PS version 1.2.4 Unfortunately, after logging into Facebook I get redirected to the shop: http://MY_SITE/authe...on.php?code=AQB[...]W#_=_ and I have: Hack attempt. What is wrong? How to correct file authentication.php for PS 1.2.4? this part: /* FB Connect */ //-------------------------------- if (Tools::getValue('fb')) { $create_account = 1; $smarty->assign('email_create', 1); $smarty->assign('fb_connect',1); $smarty->assign('appid', Configuration::get('FB_APPID')); } if (Tools::getValue('registered')) { //echo '<p>signed_request contents:</p>'; $response = FBTools::parse_signed_request($_REQUEST['signed_request'],Configuration::get('FB_SECRET')); $reg_metadata_fields = '[ {"name":"name"}, {"name":"first_name"}, {"name":"last_name"}, {"name":"email"}, {"name":"password"}, {"name":"birthday"}, {"name":"gender"}, {"name":"captcha"}]'; //echo '<pre>'; //print_r($response); //echo '</pre>'; if (strcmp($reg_metadata_fields,$response['registration_metadata']['fields']) != 0) $errors[] = Tools::displayError('registration metadata fields not valid'); if (Customer::customerExists($response['registration']['email'])){ //$errors[] = Tools::displayError('someone has already registered with this e-mail address (this module need further development)'); //$smarty->assign('email_create', 1); //$smarty->assign('existing_user', 1); //$smarty->assign('appid', Configuration::get('FB_APPID')); $customer = new Customer(); $authentication = $customer->getByEmail($response['registration']['email']); $customer->fb_uid = $response['user_id']; $customer->active = 1; $customer->deleted = 0; //$_POST['lastname'] = $response['registration']['last_name']; //$_POST['firstname'] = $response['registration']['first_name']; //$_POST['passwd'] = $response['registration']['password']; //$_POST['email'] = $response['registration']['email']; //$errors = $customer->validateControler(); $cookie->id_customer = intval($customer->id); $cookie->customer_lastname = $customer->lastname; $cookie->customer_firstname = $customer->firstname; $cookie->logged = 1; $cookie->passwd = $customer->passwd; $cookie->email = $customer->email; if (Configuration::get('PS_CART_FOLLOWING') AND (empty($cookie->id_cart) OR Cart::getNbProducts($cookie->id_cart) == 0)) $cookie->id_cart = intval(Cart::lastNoneOrderedCart(intval($customer->id))); Module::hookExec('authentication'); if ($back = Tools::getValue('back')) Tools::redirect($back); Tools::redirect('my-account.php'); $existing_user = 1; } if (!sizeof($errors)) { $customer = new Customer(); $customer_birthday = explode('/',$response['registration']['birthday']); $customer->birthday = intval($customer_birthday[2]).'-'.intval($customer_birthday[0]).'-'.intval($customer_birthday[1]); if ($response['registration']['last_name'] == "male") $_POST['id_gender'] = 1; else if ($response['registration']['last_name'] == "female") $_POST['id_gender'] = 2; else $_POST['id_gender'] = 9; $_POST['lastname'] = $response['registration']['last_name']; $_POST['firstname'] = $response['registration']['first_name']; $_POST['passwd'] = $response['registration']['password']; $_POST['email'] = $response['registration']['email']; $errors = $customer->validateControler(); $customer->fb_uid = $response['user_id']; if (!sizeof($errors)) { $customer->active = 1; if (!$customer->add()) $errors[] = Tools::displayError('an error occurred while creating your account'); else { if (!Mail::Send(intval($cookie->id_lang), 'account', 'Welcome!', array('{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{email}' => $customer->email, '{passwd}' => $response['registration']['password']), $customer->email, $customer->firstname.' '.$customer->lastname)) $errors[] = Tools::displayError('cannot send email'); $smarty->assign('confirmation', 1); $cookie->id_customer = intval($customer->id); $cookie->customer_lastname = $customer->lastname; $cookie->customer_firstname = $customer->firstname; $cookie->passwd = $customer->passwd; $cookie->logged = 1; $cookie->email = $customer->email; Module::hookExec('createAccount', array( '_POST' => $_POST, 'newCustomer' => $customer )); //$fbcookie = FBTools::get_facebook_cookie((Configuration::get('FB_APPID')), (Configuration::get('FB_SECRET'))); if ($back) Tools::redirect($back); Tools::redirect('my-account.php'); } } } } if (Tools::getValue('fblogin') OR Tools::getValue('code')) { $app_id = (Configuration::get('FB_APPID')); $app_secret = (Configuration::get('FB_SECRET')); $my_url = "http://".$_SERVER['HTTP_HOST']."/authentication.php"; $code = $_REQUEST["code"]; if(empty($code)) { $dialog_url = "http://www.facebook.com/dialog/oauth?client_id=" . $app_id . "&redirect_uri=" . urlencode($my_url); echo("<script> top.location.href='" . $dialog_url . "'</script>"); } $token_url = "https://graph.facebook.com/oauth/access_token?client_id=" . $app_id . "&redirect_uri=" . urlencode($my_url) . "&client_secret=" . $app_secret . "&code=" . $code; $access_token = file_get_contents($token_url); $graph_url = "https://graph.facebook.com/me?" . $access_token; $user = json_decode(file_get_contents($graph_url)); $customer = new Customer(); $authentication = $customer->getByEmail($user->email); //print_r($user); /* Handle brute force attacks */ sleep(1); if ($user->id != $customer->fb_uid) $errors[] = Tools::displayError('fb login authentication failed'); else { $cookie->id_customer = intval($customer->id); $cookie->customer_lastname = $customer->lastname; $cookie->customer_firstname = $customer->firstname; $cookie->logged = 1; $cookie->passwd = $customer->passwd; $cookie->email = $customer->email; if (Configuration::get('PS_CART_FOLLOWING') AND (empty($cookie->id_cart) OR Cart::getNbProducts($cookie->id_cart) == 0)) $cookie->id_cart = intval(Cart::lastNoneOrderedCart(intval($customer->id))); Module::hookExec('authentication'); if ($back = Tools::getValue('back')) Tools::redirect($back); Tools::redirect('my-account.php'); } } //-------------------------------- for_PS1.2.4_with_PWA.zip
  7. In this case, the script generates a lot of 404 errors because of the presence of cloud-zoom.1.0.2.min.js file references to "." If someone does not want 404 errors should be changed file cloud-zoom.1.0.2.min.js: <div class='mousetrap' style='background-image:url(\".\") to: <div class='mousetrap' style='background-image:url(\"/img/empty.png\") and upload a file empty.png to a folder /img.
  8. razro: How to make modifications to the cloud of zoom - when click on the picture then is opened in a standard lightbox window with a big image.
  9. Yes, I have very old PS 1.2.5. HookNewOrder not working correctly in PS 1.2.4 and 1.2.5. (module code is executed after the approval of the order and first of the day have wrong number). Dirty hack can be placed after line ~15 order.php file(PS 1.2.5) $errors = array(); /* here */ - it will work.
  10. Problem is with hook. Solution is uninstall the module and move dirty hack in order.php under function: if (!$cart->checkQuantities()) { $step = 0; $errors[] = Tools::displayError('An item in your cart is no longer available, you cannot proceed with your order'); } should look like this: if (!$cart->checkQuantities()) { $step = 0; $errors[] = Tools::displayError('An item in your cart is no longer available, you cannot proceed with your order'); } /* Number of order */ $order_res = Db::getInstance()->Execute("SHOW TABLE STATUS LIKE '"._DB_PREFIX_."orders'"); $order_row = mysql_fetch_assoc($order_res); $order_nextautoid = $order_row['Auto_increment']; mysql_close($order_res); if (substr($order_nextautoid, 0, 6) != date("ymd")) { Db::getInstance()->Execute('ALTER TABLE `'._DB_PREFIX_ .'orders` AUTO_INCREMENT = '.intval(date("ymd").'001')); } ...and voila.
  11. I give up. I have no idea why for me it will not work correctly. I do not know why the hook newOrder is executed after confirmation of order. I move a “dirty” hack to order.php - now is ok!. tnx DenisDT and angora!
  12. I have (in this moment) in auto_increment in ps_orders table value: 110404006 If You do order (in this moment), it will have the number 110404006 - should get 110406001. Next order (second today) will have a number 110406001. Why? sorry for my woodish english.
×
×
  • Create New...