redbullmarky
Staff Alumni-
Posts
2,863 -
Joined
-
Last visited
Never
Everything posted by redbullmarky
-
fair comment. original point still stands about the content being cleared, though. Would be good to see more features in terms of formatting the text too - and as it's AJAX, you could have it auto-update the formatted result instead of clicking the button. Failing that, a simplified, stripped down version of TinyMCE/FCKEditor would be a good direction to aim.
-
clicking on any of the top toolbar buttons when nothing selected actually completely replaces all of the text in the box with the selected bbcode. also, with so many lightweight replacements for textareas, that provide a fair amount of WYSIWYG support, I do kinda wonder what the point/aim is.
-
Artificial Intelligence Bots
redbullmarky replied to Ninjakreborn's topic in PHPFreaks.com Website Feedback
i'll be honest, the thread title got me in more than anything! it's a bit like they do on technical support "contact" pages - i think paypal do it - along the lines of "The following results are similar to your question. Please take a look to see if they answer your question before hitting the submit button" albeit just with a different approach. I'd be up for it if it was a competition. -
[code] <?php echo '1,176,470,588,235,294'; ?> [/code] does that count now? ;D
-
yeah definitely. I've not gotten into it as much as you seem to have, mainly because I keep alot "in house", but in terms of being able to break down/improve what you have/need, it's definitely the dogs bollocks - who better to get advice/stats about what you get/what you need to improve on than the Kings of Search themselves...
-
this is the right link by the looks of things: http://www.phpfreaks.com/manuals/mysql/mysqlmanual.php
-
wow. "Roaming" costs for calls within the same country - and I thought WE were the ones getting ripped off :o
-
i see where you're coming from, but optimizing for search engines can come from alot of areas, not just text nav links. It's always a good idea to set the 'alt' of an image anyway as it wont validate as valid XHTML otherwise, and provides a nice alternatives for other forms of media where graphics are not supported or required. Links at the bottom, to me, generally get used for secondary stuff (Terms and Conditions, Copyright notice, About Us, Media, etc - just take a look at a few to see what I mean). What bugs me is not so much the fact that it's there, but the fact that it replicates. Avoiding replecation on pages is a good place to start in the whole process of tidying things up a bit. Cheers Mark
-
it has a certain charm about it, and you managed to use a quirky font without resortign to Comic Sans, so credit where credit's due. However, as you're going to be making money from this site, you really need to move it to a paid host, so that you can lose the google ad banner and sign saying "this site is hosted free". You could probably use a splash of colour in there too, be it an image or jazzing up the logo slightly. Also, your navigation - it's repeated twice (partially) which is unnecessary, the second of which is tucked right at the bottom of the page. the same goes for your search input box - do you really need two? and it maybe worth looking at creating your own search box, just so that your site isnt littered with 3rd party stuff (like PicoSearch) - it just takes away some of the professionalism that would be required to get money out of people. Cheers
-
word of warning though - take what you read with an open mind, rather than gospel. The first link provided links to a site that i've found nothing short of fantastic, however I disagree with that particular article.
-
i actually prefer Mac OSX overall, but chose Windows mainly because of how comfortable I am with it and how quickly I can get around and just get on with stuff. Mac OSX has lots of eye candy and looks/operates a hell of a lot better, but I can't confidently say that if i had a 'technical' problem I'd be able to fix it without some serious Googling and headscratching. If Linux supported Logic Pro or Cubase natively (which I don't believe it does) for music production, then I'd probably switch to Linux, as a few hours playing around, I was impressed at how (contrary to popular belief) how easy it was to get around, etc.
-
change this line, just before your error: $result = mysql_query($query, $connection); to this [code] $result = mysql_query($query, $connection) or die(mysql_error()); [/code] the error is a result of a problem getting a resource id as a result (possibly) of the query failing. [b]edit[/b] also, when first writing code and hence needing to debug/test as you go, try to avoid the @ error supressor that you used in your first mysql_connect. if the query i mentioned above is valid, then chances are there has been an error connecting properly to your database.
-
in your first post, you provide two bits of code. the bit that draws the box, and the bit of code that you say should go in it. what exactly happens when you actually put the said code into the other code? [b]edit[/b]: PS, if you wrap your code that you post here in [ code] [ /code] tags (without the spaces), it'll make things a little easier for us to read. cheers
-
what's wrong with the actual paypal documentation? IMO, it's not a fun and easy read (neither are most API docs) but when it comes to stuff like security, accepting payments, etc, you've really got to do some serious legwork to not just integrate it, but to understand it and what's going on too. All too often, security and payment issues are taken too lightly. However, a google search for 'paypal tutorial php' came up with [url=http://www.bigbiggeek.com/pages/paypaltutorial.html]this[/url] article. good luck
-
i'm not following.. can you be more specific as to where you're stuck, or are you wanting the code to be written for you? cheers Mark
-
have you got some code for what you've tried so far?
-
I do personally think that (whilst there's alot of overhead issues with Cake other than AJAX) they have a nice way of doing it that keeps the performance hit down pretty well. I'm talking away from any "norm" or hard research here, but I dont see too much harm in invoking the framework for a second time. Depending on how your dispatcher/router works could make some decisions, based on the type of request, of exactly how much legwork to do. When I strip away all the normal crap during an AJAX call, there's really not much difference compared to a regular application AJAX call, but comes with the benefits that the PHP files invoked via AJAX can access my framework in just the same way, keeping everything nice and tight. I guess it just depends. I've toyed recently with storing a Registry object in a session, which holds all of my persistent info (including DB/config/etc info) and it seems to do a good job, although I've not played around enough to commit to this way as yet. I guess it's all food for though, and yeah - AJAX does throw a bit of a spanner in the works in terms of maintaining a nice clean structure, but from what i've tried out so far incorporating it in the framework just like a normal page request, it does the job nicely.
-
i actually "borrowed" the idea from Cake here. They structure their URI's in a /class/method/id/ type way, but also allow stuff like /bare/class/method/id/ and /ajax/class/method/id/ etc which doesnt concern itself with regular layouts. Their complete layouts are made in two parts - the "master" template (or layout file), and the inner template which is method specific. my own framework uses this method too for a few things that need to be able to access the models, helpers, libraries, etc in the same way as a regular call, but without the extra overhead. The only difference with prepending 'ajax' to the URI is that the "master" layout file is totally ignored and the method-specific template is only used if specifically told to, whereas with a normal call, it would be required and included automatically. make sense? in my case, rendering the actual HTML from the controller is actually the longest part of the process, so simply cutting this bit out allows me to still serve an AJAX page, but with pretty minimal overhead. I actually treat images/files the same way. Rather than create a seperate script that doesnt use my framework to make the DB connections, serve the files, etc, I actually have URI's such as /image/thisfile.jpg/100/100/crop/ (the numbers being option, max width, height, etc, followed by an option 'scale' method). Again, whilst unrelated to AJAX, literally everything goes through the framework (albeit the difference with images/files is the whole process gets stopped short of invoking the controller). fingers crossed that made some sense ;) [b]edit[/b]: a good example that does a similar thing is here: http://video.derekallard.com/ for the CodeIgniter framework, but it should give you a good idea of how they integrate AJAX into the scheme of things. hope it helps! cheers
-
dude, if you've got further questions, then it'd make everyone's life easier if you opened a new topic. locked.
-
they're called 'breadcrumbs'. If you do a google search on "breadcrumbs tutorial php" there are quite a few. take your pick :) however, if you've got the basics down, they're generally not too hard to create as they're literally a group of hyperlinks. how you form the whole line of them really depends on the structure of your data and/or pages. good luck
-
How to run a script when a hyperlink is pressed
redbullmarky replied to pantinosm's topic in PHP Coding Help
if you want to run a query (ie, perform a server side action) without reloading the page, then as taith suggested, it'd be a job for AJAX and would be invoked using javascript's onClick method. for more info on AJAX, including tutorials, etc, try here: http://www.ajaxfreaks.com/ -
yeah - generally, to keep the quality, the function you're after is [url=http://www.php.net/imagecopyresampled]imagecopyresampled[/url]. it takes box coordinates of the source, box coordinates for the destnation, and voila. the working out comes seperately, but generally follows something like this: [code] <?php $filename = "test.jpg"; $w = 200; // max width $h = 200; // max height //first open the file $im = imagecreatefromjpeg($filename); // get its width/height $sx = imagesx($im); $sy = imagesy($im); // work out the scale. $w would be initially set to the max width, $h to the max height $scale = min($w/$sx, $h/$sy); // send the necessary headers to the browser: header("Content-type: image/jpeg"); // scale < 1 means it needs resizing as too big if ($scale<1) { // work out the new width/height $newwidth = $scale * $sx; $newheight = $scale * $sy; // create a 'canvas' for it $im2 = imagecreatetruecolor($newwidth, $newheight); // do the copying and send to browser imagecopyresampled($im2, $im, 0, 0, 0, 0, $newwidth, $newheight, $sx, $sy); imagejpeg($im2); // clean up imagedestroy($im); imagedestroy($im2); } else { imagejpeg($im); imagedestroy($im); } ?> [/code]
-
ok, might be worth taking a look for thumbnail scripts anyway, but generally it involves [url=http://uk.php.net/gd]GD library[/url] to open, resize and display the smaller version. What its ability is to handle HUGE images is, I couldnt tell you...
-
do you mean like a thumbnail, just a bigger version?
-
whilst it might not solve the problem, lets try getting things into the "normal" way of doing things. [url=http://uk2.php.net/imagejpeg]imagejpeg[/url] (function) takes 3 parameters - the 'resouce', a '[b]destination[/b]' filename, and a 'quality' setting. [code] <?php $im = imagecreatefromjpeg('testimage.jpg'); header('Content-type: image/jpeg'); imagejpeg($im); ?> [/code] the default quality setting for imagejpeg is 75%. if you want higher, use (for example) [code] imagejpeg($im, '', 90); [/code] have you tried this on a different browser yourself, just to make sure that its not an issue of what the browser is set to accept?