Jump to content

defeated

Members
  • Posts

    246
  • Joined

  • Last visited

Everything posted by defeated

  1. Hi Muddy, That's what I was thinking, but there are two sets of script tags within the google code and I don't want to send the solution to the client without being sure it's going to work. In theory it would, but I'm just not hot enough on JS to know for sure.
  2. Hi, Javascript isn't my thing at all. However in this instance I have to use javascript instead of php. I'm trying to add some Google experiment code to just some pages of a site. Here's what I have so far... <script type=“text/javascript”> var theUrl = window.location.href; var lWr=theUrl.toLowerCase(); if(lWr.indexOf(‘the/page/path’) >=0){ <!-- Google Analytics Content Experiment code --> <script>function utmx_section(){}function utmx(){}(function(){var k='63538864-5',d=document,l=d.location,c=d.cookie; if(l.search.indexOf('utm_expid='+k)>0)return; function f(n){if(c){var i=c.indexOf(n+'=');if(i>-1){var j=c. indexOf(';',i);return escape(c.substring(i+n.length+1,j<0?c. length:j))}}}var x=f('__utmx'),xx=f('__utmxx'),h=l.hash;d.write( '<sc'+'ript src="'+'http'+(l.protocol=='https:'?'s://ssl': '://www')+'.google-analytics.com/ga_exp.js?'+'utmxkey='+k+ '&utmx='+(x?x:'')+'&utmxx='+(xx?xx:'')+'&utmxtime='+new Date(). valueOf()+(h?'&utmxhash='+escape(h.substr(1)):'')+ '" type="text/javascript" charset="utf-8"><\/sc'+'ript>')})(); </script><script>utmx('url','A/B');</script> <!-- End of Google Analytics Content Experiment code --> } </script> Obviously that doesn't work, but I can't figure out how to make it work. Help please.
  3. Thanks KevinM1, I've added the display:none; Can't believe I didn't think of that as a solution! The flowers need to stay in the header so that there is a graphical display of their work no matter what page you land on. Same goes for the social media. The right col social media box will not be on all pages as it is now. It may not be on any in fact. I will go back to them about the fonts and colours (contrast). The footer is absolutely positioned on everything but the ipad and iphone because it doesn't work properly there. The footer looking like that was a stipulation. The only other alternative would be to create a scrolling mid section that doesn't reach the footer, but I'm not convinced by that as an approach, particularly because I would have to cater for different screen resolutions. My little netbook only has 600px depth. The header is a LOT bigger than I originally designed it. This was because the client wanted the logo to be much bigger than I had it. Thanks. That's lots of food for thought.
  4. Thanks Sunfighter. I guess what I really want to know from people is, if it was their wedding and they were looking for wedding flowers, what, if anything would you be looking for on the site that isn't there. Is there anything you would automatically look for that you cant find that may lead you to go to another site without getting in contact. Design is one thing on a site, but it's very easy to overlook things that would add to or take away from usability.
  5. Hi, One more site for you... this one is a wedding flowers site that is based on wordpress. The theme is custom. If you were looking for a wedding florist would you use this company based on the site. The site is very new and needs a lot more content, but I want to see if people find it inviting or would prefer something else. Cheers.
  6. Thank you all for the feedback. The main slider is indeed nivoslider. It seems that the general consensus is that there is too much movement even though there are differing opinions on what should and should not be moving. Your feedback is in perfect time for my meeting later today. Overall I'm delighted. The feedback is much more positive than it was for the last version of the site. It looks like we have gone from one extreme to the other.... the last one had no movement at all. Does anybody else think the "connect with us..." bit is OTT? We thought it was cute and different, but it's hard to be objective when you are in the middle of creating it! I like the idea of only moving the testimonials on a hover, but the problem is a lot of them are very long so they won't fit to a standard box size at all. Similarly, with the main slider, we were finding that people were never reading a lot of the information on the page because it was far too long. The slider let us highlight more of the page content. That said, the whole page will be rewritten soon, we just didn't want to change too much too fast and risk dropping in Google. The layout change went fine though with no drop. The heartbeat will definitely be staying since it was specifically requested. Thanks for everything so far. Looking forward to hearing more feedback!
  7. I agree on the movement thing, but I've been overruled. Didn't test in ie7... have just had a look using browsershots. Ouch. Looks like there's two problems, one with the hot jobs section and another with ie7 clearly not recognising display:table; in the main section. That's 200 visitors a month getting short changed. Grrrrr. Thanks Floridaflatlander.
  8. I like the site but there is one really important thing missing.... How much? Related to that is .. How Many? I may like the look of your videos, but without finding out how much it's going to cost and for how many lessons I'm going to go somewhere else... within a minute. I'm not going to go looking for it either. If I don't see it I'm moving on. I hope it works out for you. Ian.
  9. I also do not think that the button will get noticed. While you have spent a long time looking at the picture and it seems obvious, the rest of the world is more likely to just glance at the picture. It doesn't tell people any information that is relevant to what they are looking for. If the picture represents your team, why not make each person clickable and bring up a short profile on them. If you want to keep it fun then add in hobbies or nicknames or something to the profile. Use ajax to create a hover box so that users don't have to leave the page to get the information. Then explicitly write below or above the picture "Hover to learn more about us" or something.
  10. Hi, I'd be really grateful if I could get some feedback on a redesign of our medical jobs website. This is its third incarnation. There is still quite a bit to be done as far as we are concerned, but it would be great to have some feedback on how we are doing so far and get some ideas for what we could do to make it more user friendly too. Cheers. Ian
  11. I really like it! I do find the left box text change a little jarring, but you have to work with what the client wants and it's not too cluttered and looks great to my mind.
  12. Hi, Could somebody please explain to me why the following code returns a 400 error. I've been sitting looking at it for hours and I can't see anything wrong with it, but then again I don't know too much about cURL. <?php // INSTANTIATE CURL. $curl = curl_init(); // CURL SETTINGS. curl_setopt($curl, CURLOPT_URL, "http://twitter.com/statuses/user_timeline/96966578.xml"); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 0); // GRAB THE XML FILE. $response = curl_exec($curl); // Get information about the response $responseInfo=curl_getinfo($curl); // Close the CURL connection curl_close($curl); curl_close($curl); // Make sure we received a response from Twitter if(intval($responseInfo['http_code'])==200){ // Display the response from Twitter $content .= "Success code response:". $response; }else{ // Something went wrong $content .= "Error: " . $responseInfo['http_code']; } // SET UP XML OBJECT. $xmlObjTwitter = simplexml_load_string( $response ); $content .="<h3>Your last 10 twitter posts....</h3>\n" ; $content .= "<ul> \n"; $tempCounter = 0; foreach ( $xmlObjTwitter -> item as $item ) { // DISPLAY ONLY 10 ITEMS. if ( $tempCounter < 11 ) { $content .= "<li><a href=\"{$item -> guid}\">{$item -> title}</a></li> "; } $tempCounter += 1; } $content .="</ul>\n"; echo $content ; ?>
  13. Thank you for clearing that up. Delighted that strtotime() takes into account time zones. The storage will not be a problem because the values are only stored in the db long enough to create a new rss feed of the last 5 posts from all aggregated feeds (select * from table order by pubDate desc). I have a feed reader that posts to twitter. When it calls my aggregation page it calls it as feed_whatever.xml and I use mod rewrite in .htaccess to call aggregate.php?id=whatever Then the page reads all feeds associated with 'whatever' from a table, puts the contents of those feeds into a temp table and calls out the last 5 entries ordered by date (thus an aggregated feed). It then places those entries into xml format as a new feed. It reads that feed and posts any new entries to twitter.
  14. Thanks, In the end I went for $pubDate = mysql_real_escape_string($pubDate); $pubDate = date("Y-m-d H:i:s", strtotime($pubDate)); which I doubt does what I was asking for (taking into account time zones), but at least it works. If anybody can tell me if it will take time zones into consideration I'd be grateful.
  15. Hi, Whenever it comes to dates I go blank and just hear/read "blah blah blah". I'm sure there's a name for a condition like that but it's causing me a problem right now. I am making a RSS feed aggregator, inserting RSS feed posts into a mysql db and want to be able to extract those posts in order by date. (so that I can create a new feed of the last posts of multiple rss feeds) My problem is that the pubDate format for feeds is Fri, 29 Oct 2010 11:22:58 +0000 and that doesn't work with mysql. Apart from having to reformat the date I have to take into consideration the +0000 part could be different depending on where in the world the feed was published. Any pointers would be gratefully received!
  16. <?php mysql_connect("localhost", "admin", "1admin") or die(mysql_error()); mysql_select_db("test") or die(mysql_error()); ?> mySql is indeed set up on your web server. This forum is THE best forum there is for PHP. The tutorials at w3schools and tizag.com are great and nothing beats here when you get stuck. I had no programming background at all (.asp will be an advantage - C would be even better since it's nearly exactly the same) and while I'm not an amazing php programmer I can find my way around now, all thanks to the tutorials and this site.
  17. I don't know what's in it or what else may be using it but try removing the line require_once 'db-functions.inc.php' ; //custom database functions which should really be require_once('db-functions.inc.php') ; //custom database functions anyway and see what happens. Something in that file there is making mysql unhappy (on line 29). If that doesn't work (or breaks something else) post line 29 from db-functions.inc.php and we will see what will be. Although I won't for now cuz I'm off to bed!
  18. <?php include('include/myConn.php'); //contains your mysql connection and table selection //if statement deals with posted form: will be ignored if form has not been posted. //mysql_real_escape_string sanitizes in case of injection //ideally I would use a line like //$myTitle=mysql_real_escape_string($_REQUEST['mytitle']; outside of the query //and in the query have //myTitle=$myTitle, if($_REQUEST['POSTBACK'] == "EDIT") { mysql_query("UPDATE myAbout SET myTitle=mysql_real_escape_string($_REQUEST['myTitle']), myDesc=mysql_real_escape_string($_REQUEST['myDesc']), myHeader=mysql_real_escape_string($_REQUEST['myHeader']), mySubHeader=mysql_real_escape_string($_REQUEST['mySubHeader']), myPageData=mysql_real_escape_string($_REQUEST['myPageData'])") or die("Problem updating db: ".mysql_error()); ?> <script language="JavaScript"> alert("This page was updated!"); location.href = "<%=Request.ServerVariables("URL")%>"; </script> <?php }//end if statement //now we want to pull all data from the table myAbout to populate form $query=mysql_query("SELECT * FROM myAbout") or die("Could not get data from db: ".mysql_error()); while($result=mysql_fetch_array($query)) { $myTitle=$result['myTitle']; $myDesc=$result['myDesc']; $myHeader=$result['myHeader']; $mySubHeader=$result['mySubHeader']; $myPageData=$result['myPageData']; }//end while ?> <html> <head> </head> <body> <div id="mainContent"> <h1>Editing</h1> <p> <form method="post" action="<?php echo $PHP_SELF;?>"> <input type="hidden" name="POSTBACK" value="EDIT"> <div style="float: left; width: 120px; margin-right: 30px;"> Page Title: </div> <div style="float: left; width: 550px;"> <textarea cols="80" rows="1" name="myTitle"><?php echo $myTitle; ?></textarea> </div> <div style="clear: both;"><br /></div> <div style="float: left; width: 120px; margin-right: 30px;"> Page Description: </div> <div style="float: left; width: 550px;"> <textarea cols="80" rows="1" name="myDesc"><?php echo $myDesc; ?></textarea> </div> <div style="clear: both;"><br /></div> <div style="float: left; width: 120px; margin-right: 30px;"> Page Header: </div> <div style="float: left; width: 550px;"> <textarea cols="80" rows="1" name="myHeader"><?php echo $myHeader; ?></textarea> </div> <div style="clear: both;"><br /></div> <div style="float: left; width: 120px; margin-right: 30px;"> Page SubHeader: </div> <div style="float: left; width: 550px;"> <textarea cols="80" rows="1" name="mySubHeader"><?php echo $mySubHeader; ?></textarea> </div> <div style="clear: both;"><br /></div> Page Content:<br /> <textarea cols="80" id="myPageData" name="myPageData"><?php echo $myPageData; ?></textarea> <script type="text/javascript"> CKEDITOR.replace( 'myPageData' ); CKFinder.setupCKEditor( editor, '/ckfinder' ); </script> <br /> <input type="submit" value="Submit" /> </form> </div> </body> </html> I'm not sure about the javascript alert. I think the way I have it means it will trigger every time the page is called (including first call). I'm not too hot on javascript.
  19. With regard to your user panel, the form is very straight forward with the exception of the content section. For that you should check out http://tinymce.moxiecode.com/. It is easy to implement. With regards to putting your form into a db then mysql is the answer. I've never worked with any other type of db but it's very straight forward and following tutorials on mysql on w3schools or tizag.com should get you started in no time. One caveat would be to watch out for injections. Any data taken from your form should be protected as in the following example: /*Get form data*/ $content=$_REQUEST['content']; // unsafe to put into db $content=mysql_real_escape_string($_REQUEST['content']);//escapes unsafe characters like ' note: $_POST['whatever'] is more usual for fetching form posted data. $_REQUEST['whatever'] works for bot POST and GET methods. I've just got into the habit of using it from laziness!
  20. I think the easiest way is to have a mysql db that stores the names and locations of the files. Then you can use $query=mysql_query("SELECT * FROM table ORDER BY RAND() LIMIT 1"); to extract one random file. I would put everything into the db though. . . and just have your jpegs in files. That means you don't even have to read any text files... just get it directly from the DB. Your columns could be something like "jpeg_location", "jpeg_alt_txt" and "description_text". That way you just have to do something with your mysql query like while($result=mysql_fetch_array($query)) { $jpeg_location=$result['jpeg_location']; $jpeg_alt_txt=$result['jpeg_alt_txt']; $description_text=$result['description_text']; echo "<img src='".$jpeg_location."' alt='".$jpeg_alt_txt."' /><br /><p>".$description_text."</p>"; Of course you could make it prettier than that but you get the idea.
  21. Perfect! Thank you. I just added in the line curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); and it worked perfectly.
  22. Why don't you do what I did... go to http://www.tizag.com and go through their tutorials. That should keep you going for quite a while. Then when you bump into problems (when you try and do something a little more complex) you can post here and get fantastic help. I would suggest you also get familiar with mysql databases. PHP and mysql together are really useful.
  23. You're missing your DB connection. <?php //connect to database mysql_connect("localhost", "Username", "password") or die(mysql_error()); //connect to specific table mysql_select_db("twitter") or die(mysql_error()); ?> I usually put my connection into a separate file called something like dbconnect.php and use the line include('dbconnect.php'); at the start of my page. You can just put the code into your page before the "$result = dbQuery("SELECT * FROM `twitter`....." line. You will also have to change the screen_name from inkplant to your own screen name. On most sites leaving "localhost" is the correct server address, but now always. Your username and password were set when you created your db. Hope that sorts it for you.
  24. It looks like you hit the nail on the head there Riboflavin! It's hard to tell without seeing the code (link doesn't work), but somewhere you have (or should have) a function called dbQuery(). It's not finding that. If your db is populating then you have got the hard bit done already. You could just find where the dbQuery() function is being called and write your own query there instead.
×
×
  • 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.