Jump to content

gerkintrigg

Members
  • Posts

    830
  • Joined

  • Last visited

Everything posted by gerkintrigg

  1. It seems so many of these topics cross over, so I hope it's in the right place. I've got a site using minicart.js to add things to the shopping cart. I love the way it works so-far, but I want to now output it using PHP variables so I can link it to PayPal. All I want is a dump into a PHP script. I don't care how, particularly... ideally an array of some kind with item ID and quantity... but anything. Once it's in PHP, I'm good... I can do the rest, but I'm a ludite with Javascript. Please help.
  2. Hi, I've tried to program a shopping cart App and it works fine on my Mac and my Android Phone, but on the IPad, it's not adding the items to the shopping cart. I've used a free template that does most of the hard work for me, but used some database stuff to get the shop actually listing stuff. My URL is: http://www.bristolmagicshop.com/single.php?id=14 So-far, so-good, but the iPad issue is starting to bug me now. Any suggestions? Neil
  3. I hope this is in the right place, if not, please redirect. Since Google's update to rank mobile-friendly sites higher than mere mortals, I made a website to accomodate the new rules. It's acting weird though. Google are indexing everything correct for the homepage, but the URL they've got is for a random blog article I wrote. I have no clue why these are being mixed. The Javascript screen resolution redirect is working fine and doesn't take me to that article. There are no htaccess issues and the php scripts work fine for everything I test on. Do we know about any issues that might cause this? Neil
  4. No offence taken... It's not my script. I just changed it. Was RSS around 12+ years ago? The error is found with the output: error on line 42 at column 8: Encoding error But this is found at: http://www.tingifts.co.uk/RSS/blog_feed.xml
  5. Hi everyone. I'm not too up on XML (shame on me!) I've written the following class, but it keeps getting an encoding error... I know the other elements of the procedure (the other scripts) are right... or at least I think they are. I've narrowed the issue down to somewhere in this script (probably the first few lines) Can anyone help? I'm lost! Thanks, Neil <?php class RSSFeed { // VARIABLES // channel vars var $channel_url; var $channel_title; var $channel_description; var $channel_lang; var $channel_copyright; var $channel_date; var $channel_creator; var $channel_subject; // image var $image_url; // items var $items = array(); var $nritems; // FUNCTIONS // constructor function RSSFeed() { $this->nritems=0; $this->channel_url=''; $this->channel_title=''; $this->channel_description=''; $this->channel_lang=''; $this->channel_copyright=''; $this->channel_date=''; $this->channel_creator=''; $this->channel_subject=''; $this->image_url=''; } // set channel vars function SetChannel($url, $title, $description, $lang, $copyright, $creator, $subject) { $this->channel_url=$url; $this->channel_title=$title; $this->channel_description=$description; $this->channel_lang=$lang; $this->channel_copyright=$copyright; $this->channel_date=date("Y-m-d").'T'.date("H:i:s").'+01:00'; $this->channel_creator=$creator; $this->channel_subject=$subject; } // set image function SetImage($url) { $this->image_url=$url; } // set item function SetItem($url, $title, $description) { $this->items[$this->nritems]['url']=$url; $this->items[$this->nritems]['title']=$title; $this->items[$this->nritems]['description']=$description; $this->nritems++; } // output feed function Output() { $output .= '<?xml version="1.0" encoding="UTF-8" ?>'."\n"; $output .='<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">'."\n"; $output .= '<channel>'."\n"; # rdf:about="'.$this->channel_url.'">'."\n"; $output .= '<title>'.$this->channel_title.'</title>'."\n"; $output .= '<atom:link href="http://www.tingifts.co.uk/blog/" rel="self" type="application/rss+xml"/>'."\n"; $output .= '<link>'.$this->channel_url.'</link>'."\n"; $output .= '<description>'.$this->channel_description.'</description>'."\n"; $output .= '<lastBuildDate>'.$this->channel_date.'</lastBuildDate>'."\n"; $output .= '<language>'.$this->channel_lang.'</language>'."\n"; $output .= '<sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency>'."\n"; $output .= '<generator>http://www.tingifts.co.uk</generator>'."\n"; $output .= '<item>'."\n"; for($k=0; $k<$this->nritems; $k++) { $output .= '<title>'.$this->items[$k]['title'].'</title>'."\n"; $output .= '<link>'.$this->items[$k]['url'].'</link>'."\n"; $output .= '<image>'."\n"; $output .= ' <url>'.$this->image_url.'</url>'."\n"; $output .= ' <title>'.$this->items[$k]['title'].'</title>'."\n"; $output .= ' <link>'.$this->items[$k]['url'].'</link>'."\n"; $output .= '</image>'; $output .= '<description>'.$this->items[$k]['description'].'</description>'."\n"; }; $output .= '</item>'."\n"; $output .= '</channel>'."\n"; $output .= '</rss>'."\n"; return $output; } }; ?>
  6. Hi all, I've tried to access the admin.php of the xcart installation here: http://www.cleaningshopuk.com but it doesn't allow me to access it, saying that it's a 404 page not found error. That page does in fact exist, but I think the issue might be something to do with a redirection. The site owner apparently clicked on something in the admin section (possibly https or something similar) but what can I do to avoid this issue without having to re install everything? Thanks, Neil
  7. Hi all, Recently I have found myself repeating a very monotonous task on amazon's kindle direct publishing website and (being the kinda guy I am), I figured I could probably automate it without too much trouble. I'm a publisher who needs to maintain my library of lots of books and ensure that any offers are kept up-to-date. I have made screen scrapes before without too much problem, but filling in forms is a little bit more difficult. There are no CAPCHA images to enter and this is specific to my own login so I don't think I can be considered "evil", so all I want to know is how to automate my own login, click a specific link and fill in forms. Ideally I want it as easy as recording a macro, or maybe just a list of instructions. If I told a human to do it, I'd just say "go to this page and click on that, enter these details to login, then click that" and I wondered if there is something out there in cyber world that allows me to do the same? Thanks, Neil
  8. Did you read that this is not a code repository? Please explain what the issue is and what you have done to try to work out what the error is. This looks like you have taken someone else's code and because it doesn't work first time, you want us to sort it out. I don't want to read pages of code in the hope I might find something wrong and that's probably why you have no responses to your post. Start by working out which page of code it is. To do that, use the die() command to stop the process part way through and output variables using echo. Use some logic to check it's doing what it should. Then once you have narrowed it down a bit on your own, post something more specific. That's called debugging.
  9. Hi, I'm having issues trying to get the image of the author in the top right of the text section on this page: http://theperilouspostman.co.uk/meet_the_author.php Is there an easy way to do this without having to mess with my template? I did the wrapping around the postman, but the issue is now that the images in the page content appears at the bottom of the section. Any ideas? Neil
  10. One tiny niggle... I have sorted the homepage like this: http://theperilouspostman.co.uk/index.php But the author page, I want the author's picture to sit on the right at the top, with text wrapping around it. I can't do this in the template. The only way I worked out how to (sort of) do it is by putting the floating image code before the wrap tags, but even that isn't ideal. Any suggestions? Example: http://theperilouspostman.co.uk/meet_the_author.php
  11. fantastic! thanks for that: http://theperilouspostman.co.uk/index.php
  12. Hi everyone, I want to use CSS to wrap around an irregular shape (kinda like I've tried to do here: http://theperilouspostman.co.uk/index.php) I have had a look at some of the experimental CSS exclusions and stuff but I wondered whether there's a robust way of ensuring that people see it as I want them to, regardless of whether they have the latest browser and settings. After all, many of the audience for this site might access it from schools - and they're not well known for having the latest technology anyway. Can I do it using blank PNG files like I have here? if so, how do I make it actually work? Are there tutorials online? I've had a search and can't find what I need. Neil
  13. Hi all, I'm trying to import data via an RSS feed. I can get everything else to work fine, but there's a few weird symbols creeping in that I can't replace or remove. (see the salary at http://www.truro.com/jobs-board/c++-developer_168.html) I have tried string replacments and url encodes, but nothing works. Any suggestions? Neil
  14. I've done this: function loadLog(){ var oldscrollHeight = $("#chatbox").attr("scrollHeight") - 20; $.ajax({ url: "log.html", cache: false, success: function(html){ $("#chatbox").html(html); //Insert chat log into the #chatbox div var newscrollHeight = $("#chatbox").attr("scrollHeight") - 20; if(newscrollHeight > oldscrollHeight){ $("#chatbox").animate({ scrollTop: newscrollHeight }, 'normal'); //Autoscroll to bottom of div } }, }); } It would appear that this SHOULD work... but it's not.
  15. I'm using Ajax to make this chat box: Http://www.ghostlypublishing.com/chat All I want to happen is to automatically scroll to the bottom of the field. What's the easiest way to achieve this? Neil
  16. I think i've narrowed it down to this part: ####################################################################### #get the admin for pages: $fb_accounts = $facebook->api('/me/accounts'); $access_token = $fb_accounts['data'][0]['access_token']; //We can now update a Page as Admin $facebook->api('/feed', 'post', array('message'=> 'Hello!', 'access_token' => $access_token, 'cb' => '')); ####################################################################### i had thought to change "/feed" to "/pagename" or "/pagename/feed" but neither option work.
  17. Hi all, I've worked out how I can post to a page as a feed update just as me, but I want to post it as the page itself. I guess I need to tell Facebook that I'm not a mere mortal, and that I am an all-powerful admin over-lord, but how do I put such egocentric notions into syntax Facebook will understand? Everything else is working nicely. Neil
  18. Okay so if I move it out of the accessible public_html folder then I use cli to refer to the cron a use some kind of variable send mechanism to plonk a variable into the script? I guess I'll look that up. Thanks. FYI, the reason I'd use http is to run. Script that I DO want to access in the normal website life but do it as a scheduled event as well. It makes sense to only have one script doing one job. That's the whole point of database normalisation after all. ;-)
  19. Fairly quick question about crons: I want to send a variable to my cron script (which works btw), so I can make sure it's authorised to run like this: Http://www.whatever.com/crons/my_script.php?auth_code=12345 Obviously that is the http address. Will it be different when I refer to the cron in the cron tab?
  20. Hello, I want to post automatically to my Facebook page, but not to my personal account. What's the difference in coding? It's linked to my personal account perfectly using the following code: <?php require_once($root.'includes/facebook_api/facebook.php'); $config = array(); $config['appId'] = 'whatever'; $config['secret'] = 'shh. It's a secret'; $config['fileUpload'] = false; // optional $facebook = new Facebook($config); $user = $facebook->getUser(); // Get the UID of the connected user, or 0 if the Facebook user is not connected. if($user == 0) { $login_url = $facebook->getLoginUrl($params = array('scope' => "publish_stream")); echo ("<script> top.location.href='".$login_url."'</script>"); } else { try { $params = array( 'message' => "I'm trialing a new post-to-facebook app. Just ignore me.", 'name' => "Ending Today", 'caption' => "Get them while they're hot... ", 'description' => "Pre-owned listings on Truro.com ending today. They will disappear in less than 24 hours, get them now!", 'link' => "http://www.truro.com/pre-owned_ending_today.php", 'picture' => "http://www.truro.com/furniture/logo.jpg", ); $post = $facebook->api("/$user/feed","POST",$params); $go=$root.'cron_jobs/check_backlink_ncj.php'; header( 'Location: '.$go ) ; die(); } catch (FacebookApiException $e) { $result = $e->getResult(); } } ?> but I want it to post to my business page instead. Suggestions, please? Neil
  21. I've made this chat program in Ajax: http://www.ghostlypublishing.co.uk/chat The only problem is that when you post something to it, the chat window needs to scroll but it's not doing it properly. I wondered whether I'm doing it right... the main code I have which should be doing the job is: //Load the file containing the chat log function loadLog(){ var oldscrollHeight = $("#chatbox").attr("scrollHeight") - 20; $.ajax({ url: "log.html", cache: false, success: function(html){ $("#chatbox").html(html); //Insert chat log into the #chatbox div var newscrollHeight = $("#chatbox").attr("scrollHeight") - 20; if(newscrollHeight > oldscrollHeight){ $("#chatbox").animate({ scrollTop: newscrollHeight }, 'normal'); //Autoscroll to bottom of div } }, }); } It looks good to me, but hey - what do I know. ) Could anyone help out, please?
  22. Hi All, I've had a few reported bounce backs from an email list I've collected over the years (but seldom emailed to). I'd like to clean it up before I mail them again - just to make sure I don't get penalised for spam or whatever. My question is this: Is there a free online service (i mean totally free - not free trials, no "free for a little bit" services etc. that I can use? or Is there a script I could use that could verify the email addresses without getting a negative reputation for all the bounce backs - and I know there will probably be a lot. Thanks. Neil
  23. Hello, I'm trying to write a script that can get an anniversary record from a database. I can do everything if I know the year, but I want to get all years... So the code: SELECT * FROM `anni_reminder` WHERE `date` > ADDDATE(NOW(), INTERVAL -1 WEEK) Works fine if the year is this year, but I want to go back 100 years and see if the anniversary was set for this week in 1913 for example. I can't think of an easy way to loop unless I execute 100 SQL queries, but that doesn't seem a very slick way to do it. Any suggestions? Neil
×
×
  • 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.