Thread: Twitter Tweets

Page 5 of 6 FirstFirst ... 3456 LastLast
Results 41 to 50 of 60
  1. #41
    Join Date
    Oct 2007
    Location
    Australia
    Posts
    843
    Plugin Contributions
    0

    Default Re: Twitter Tweets

    Hi Wilt....I have been trying to get this to work cos I think it's great and will be a definite time saver lol I am however having an issue...when I add a new product I get these warnings on the next page:

    PHP Code:
    Warningfile_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /home/christon/public_html/digiscraps/changedadmindirectory/includes/modules/update_product.php on line 203

    Warning
    file_get_contents(http://tinyurl.com/api-create.php?url=http://www.havendesignz.com/digiscraps/index.php?main_page=product_info&products_id=1079) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /home/christon/public_html/digiscraps/changedadmindirectory/includes/modules/update_product.php on line 203

    WarningCannot modify header information headers already sent by (output started at /home/christon/public_html/digiscraps/changedadmindirectory/includes/modules/update_product.php:203in /home/christon/public_html/digiscraps/changedadmindirectory/includes/functions/general.php on line 21 
    The product does get added to both the catalog and twitter...just the link does not lol

    My admin section is password protected from CPanel, would this make a difference?
    HunnyBee Design
    "A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe

  2. #42
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Twitter Tweets

    Quote Originally Posted by LissaE View Post
    URL file-access is disabled in the server configuration

    no suitable wrapper could be found
    It has nothing to do with your cPanel.

    Your hosting company has prohibited the use of the PHP file_get_contents() function from accessing files outside your server.

    You'd have to have the hosting company relax their security (not likely an option), or rewrite the code to use another method to talk to external services.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #43
    Join Date
    Oct 2007
    Location
    Australia
    Posts
    843
    Plugin Contributions
    0

    Default Re: Twitter Tweets

    Thanx DrByte, I did some Google searches yesterday and came to the same conclusion lol

    Unfortunately I know just enough about programming to make me dangerous and not enough to rewrite the code, so unless anyone feels like jumping in this will have to take a backburner for me lol :)
    HunnyBee Design
    "A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe

  4. #44
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,930
    Plugin Contributions
    4

    Default Re: Twitter Tweets

    Quote Originally Posted by countrycharm View Post
    I have inserted the code and it is where it is suppose to be. My problem is this, when i insert a new product I get the error message bar at the top but their is no writing or nothing besides the error bar. When I look at the source code it don't show up. What am I doing wrong. Thank you.

    Are you sure that the PHP Curl extensions are available in the version of PHP your server is using.

  5. #45
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,930
    Plugin Contributions
    4

    Default Re: Twitter Tweets

    Quote Originally Posted by LissaE View Post
    Thanx DrByte, I did some Google searches yesterday and came to the same conclusion lol

    Unfortunately I know just enough about programming to make me dangerous and not enough to rewrite the code, so unless anyone feels like jumping in this will have to take a backburner for me lol :)

    Note the call to the tinyURl service is not strictly necessary and you could try the code without it, i.e just passing the plain url as part of the message.

    Twitter itself will try and shorten Urls in a message.

  6. #46
    Join Date
    Oct 2007
    Location
    Australia
    Posts
    843
    Plugin Contributions
    0

    Default Re: Twitter Tweets

    Thanx Wilt :)

    How would I try and pass the plain url?

    edited to add....would I just remove the tinyurl bits, like so:

    PHP Code:
    // BOF twitter feed
        
        
    if ($action == 'insert_product')
        {
          
    $purl zen_catalog_href_link(FILENAME_PRODUCT_INFO'products_id=' $products_id);
          function 
    updateStatus($user$password$message)
          {
            
    $url "https://twitter.com/statuses/update.xml";
            
    $curl curl_init($url);
            
    $data = array('status'=>$message);
            
    curl_setopt($curlCURLOPT_USERPWD$user.':'.$password);
            
    curl_setopt($curlCURLOPT_POST1);
            
    curl_setopt($curlCURLOPT_POSTFIELDS$data);
            
    curl_setopt($curlCURLOPT_RETURNTRANSFER,1);
            
    curl_setopt($curlCURLOPT_HTTPHEADER, array('Expect:'));
            
    $result = @curl_exec($curl);
            
    curl_close($curl);
            return 
    $result;
          }
          
    $message STORE_NAME ' has a new product. ' $purl;
          
    $user 'limelites';
          
    $password '********';
          
    updateStatus($user$password$message);
        }
        
    // EOF twitter feed 
    </span></span>
    HunnyBee Design
    "A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe

  7. #47
    Join Date
    Oct 2007
    Location
    Australia
    Posts
    843
    Plugin Contributions
    0

    Default Re: Twitter Tweets

    Ok, I tried the above, and it worked! The url was converted to bit.ly ... thanx Wilt :)

    Dunno how those span tags got in my post LOL
    HunnyBee Design
    "A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe

  8. #48
    Join Date
    Jul 2007
    Posts
    2,169
    Plugin Contributions
    16

    Default Re: Twitter Tweets

    Quote Originally Posted by limelites View Post
    OK, answered my own question again:

    $display_special_price = zen_get_products_special_price($products_id, true)


    But how do you get the price to display to two places after the decimal point? At present, it's displaying £49.9900 instead of £49.99
    How did you get this to work? What code did you use, and what file does it go in. I have everything else working like I want it. Thanks
    Is your site Upgraded to the current version 1.5.4 Yet?
    zencart-upgrades-website-installation

  9. #49
    Join Date
    Jun 2007
    Location
    Posadas, Misiones, Argentina
    Posts
    220
    Plugin Contributions
    0

    Default Re: Twitter Tweets

    Wilt, could you please, put all this improves:

    $_POST['products_name'][$_SESSION['languages_id']]

    $display_special_price = zen_get_products_special_price($products_id, true)

    round(zen_get_products_special_price($products_id, false), 2)

    like must be in the message row please?

    I try in this way:

    Code:
    $message = STORE_NAME . ' has a new product. ' . $_POST['products_name'][$_SESSION['languages_id']] . round(zen_get_products_special_price($products_id, false), 2) . $tinyPurl;
    without success...
    URL: http://www.littledreamswarehouse.com/shop
    Zen Version: 1.3.89h
    Zen Template: orange modified

  10. #50
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Twitter Tweets

    Quote Originally Posted by countrycharm View Post
    How did you get this to work? What code did you use, and what file does it go in. I have everything else working like I want it. Thanks

    /includes/modules/update_product.php

    round(zen_get_products_special_price($products_id, false), 2)

 

 
Page 5 of 6 FirstFirst ... 3456 LastLast

Similar Threads

  1. v151 Twitter Feed
    By DigiBooks in forum General Questions
    Replies: 1
    Last Post: 6 May 2015, 02:03 AM
  2. Twitter sidebox
    By karenkte in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 29 Apr 2015, 05:25 PM
  3. v151 Twitter - Tweets not showing
    By karenkte in forum General Questions
    Replies: 1
    Last Post: 8 Mar 2013, 11:49 AM
  4. Twitter
    By irishshopper in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 11 Jul 2010, 01:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg