Jump to content

QuickOldCar

Staff Alumni
  • Posts

    2,972
  • Joined

  • Last visited

  • Days Won

    28

Everything posted by QuickOldCar

  1. Well here's my opinion. Always better to have a dedicated for yourself, yes it cost more, but then again you have total control and don't have to follow anyone's limits and rules. You can even recoup some money back by hosting a few sites yourself. You start using cpu and memory the host would quickly send you a letter or even suspend you, seen it way too many times. I will make a suggestion. http://www.limestonenetworks.com/servers/quad-core-dedicated-servers.html I used to rent a dedicated i7 quad 9700, 8 gig mem, 750 sata, 2TB month bandwidth and had unlimited uploads. It never went down once in an entire years time and was lightning fast with cpu only ever hitting 30% a few times and kept the memory hovering at 4 gig as a balance point. I had 20,000+ hits a day, had a feed aggregator/auto post website that did a thousand or so websites feeds. Keep checking their specials out. These guys are instant for responses as well, they take pride in their work. I'd still have my server from them, is 2 reasons why I no longer do, I had a movie-tv website, plus I had bigger plans and that host does not allow any type of nude images or porn. Just wouldn't work for me with my new project. BTW if gonna do gd, make a cache folder for the created images to take some cpu load off. One last item, if ever wanted to do your own virtual dedicated and vps hosting can install centos and hypervm/kloxo Kloxo used to be called lxadmin Is all free and a comlete hosting solution, easy to do. http://lxcenter.org/software
  2. From what I see you are replacing those characters with an underscore, does your search work with an underscore? Did you do rewrite rules to make them work right? It's cool if it works, my urls are miles long sometimes, but I never cared how they look, as long as they work correct, but that's just me. Here's an example my basic search url just to show you http://dynaindex.com/search.php?s=%2Bfree+%2Bphp+%2Btutorial+-download+-script&page=1 Now sure I can do lots to make it look different, but for my searches I need those + and - to include and exclude, and if didn't know already spaces break hyperlinks when copy/paste them. So I just leave the urlencoded %2B Maybe you have a simpler setup and just single words and spaces
  3. I just clean them after the get and not in the form. I didn't care whats left in the url, as long as the form gets the right data. So do str_replace after on that get would be my suggestion, but might as well keep what you already have too. I'm not even entirely sure why you are searching those type url's anyway, why not use a normal search and pull the matching words from mysql fields. You know, like a normal search.
  4. Only problem with that is when have multiple bad characters and or spaces, will get a pile of ________ in one spot I'd replace: __ with _ ___ with _ ____ with _ just for good measure
  5. Used this while ago, worked pretty good, and best of yet it's free. http://sourceforge.net/projects/ajax-chat/
  6. You can create a cron job for the php code to just update the database. If you really need firefox to open for some reason it can be opened and closed running in background on the server. Not sure linux, windows, but opening and closing firefox can be done by using bat files or some sort of exec, psexec to open and close in a timely manner. All the permissions and that good stuff will have to be worked out. If need to actually have a firefox window open and playing but do a refresh , can add a header or meta redirect to refresh your pages. meta refresh every 30 seconds same content page <?php echo('<meta http-equiv="refresh" content="30">'); ?> meta refresh in 30 seconds to a new page <meta http-equiv="refresh" content="30;url=http://somesite.com/somepage.php"> using header <?php header( "refresh:30;url=somepage.php" ); ?>
  7. The image. http://destroyrebuilduntilgodshows.net/forum/images/gamesmania/advertise.png By viewing your page source - see the <img src="images/gamesmania/advertise.png" class="advertise"> <div id="wrapper_container"> <div class="logo"><a href="http://www.destroyrebuilduntilgodshows.net/forum/index.php"><img src="http://www.destroyrebuilduntilgodshows.net/forum/images/gamesmania/logo.png" alt="D.R.U.G.S Forum" title="D.R.U.G.S Forum" /></a></div> <img src="images/gamesmania/advertise.png" class="advertise"> </div> Looking in your css - highlighted the area red http://www.destroyrebuilduntilgodshows.net/forum/cache/themes/theme3/global.css #wrapper_container { padding: 10px; width:910px; margin:auto auto; } .logo { padding: 10px 0 0 0; float:left; } .advertise { padding: 10px 0 0 0; float:right; }
  8. Just wanted to add , you should check for duplicate titles, and if have same title add a number to the end of url's in increments of +1
  9. Gonna take a stab in the dark here and show you an example I just made. I didn't fully test it for all possible types, but seems to work, I'd test it though. <?php //function , can modify it more if need to function makePretty($title) { $title = trim($title); $title = str_replace(array(" "," ",","), '_', $title); $title = str_replace(array("'",'"'), '', $title); $title = strtolower(preg_replace('#\W#', '', $title)); $title = str_replace(array("__","___","____"), '', $title); return $title; } //some dummy info so i can do this $site_domain = "http://mysite.com/"; $titles = array("This is my cat","Wow That's awesome","Today's hottest ce-leb-ri-ties","You & her are @ the house","FOR SALE!!!!!","One,Two,Three...GO"); //my loop to show changes foreach ($titles as $title){ $pretty_title = makePretty($title);//makePretty function $permalink = "$site_domain$pretty_title"; echo "<a href='$permalink'>$title</a><br />"; } ?>
  10. I guess some link examples and how you are saving your current links in the database would help. Can use str_replace() and also lower them with strtolower(). The idea would be to replace all characters except for letters and numbers in the title url to a - or a _ but only after the sites name, so need to do it just for the actual link title and not the domain,path or script name Just post any information you have and see what we can do for you.
  11. Might be easier way, but I just did it like this. <?php $text = "wow {one|two|three}fsasfa happy ness"; $matches = array(); preg_match_all('#\{.*?\}|[^ ]+#', $text, $matches); foreach ($matches[0] as $word) { $v = array(); if (preg_match('#^\{(.*)\}$#', $word, $v)) { echo '<strong>' . htmlspecialchars($v[1]) . '</strong>'; } else { echo htmlspecialchars($word); } echo '<br />'; } ?> Results be wow one|two|three fsasfa happy ness Now can do anything you want with the matching values
  12. I like it too, and agree with what Maq said. Some missing files to start you off http://lincsdriver.com/templates/system/images/j_button2_right.png http://lincsdriver.com/templates/rt_affinity_j15/images/k2CalendarLoader.gif http://lincsdriver.com/templates/rt_affinity_j15/images/modules/black-arrow.png http://lincsdriver.com/templates/rt_affinity_j15/images/style3/medium-module-div.png
  13. I made a multi-word multi-color highlighter http://dynaindex.com/color-highlighter.php http://www.phpfreaks.com/forums/php-coding-help/highlight-a-word-using-php/msg1516715/#msg1516715 Is 2 diferent functions there at above link, the one i linked is for when are single values in an array, the other function below it is for when need to explode a line a text for the words, exclude anything, and then create the array. You can look there but here's an even newer version of the code I did. function highlighter($words, $content, $backgroundcolors=null, $fontcolors=null) { preg_match_all('~\w+~', $words, $matched); if(!$matched) { return $content; } $words = str_replace(array('+','-'), "", $words); $words = str_replace(" ", "|", $words); $words = trim($words); $words = explode("|", $words); if(is_null($backgroundcolors) || !is_array($backgroundcolors)) { $backgroundcolors = array('yellow', 'red', 'green', 'orange', 'aqua', 'lightskyblue ', 'pink', 'lime', 'fuchsia', 'maroon', 'navy', 'olive', 'purple', 'gray', 'silver', 'teal', 'grey'); if(is_null($fontcolors) || !is_array($fontcolors)) { $fontcolors = array('black', 'white', 'lime', 'oldlace');//change font colors or add more } } $counting = 0; $numbercolors = max(array_keys($backgroundcolors)); foreach ($words as $word) { $word = preg_quote(trim($word)); $content = preg_replace("/\b($word)\b/i", '<span style="border: solid 2px #FFD700; padding: 1px; -moz-border-radius: 5px; -khtml-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; margin: -0; text-align: justify; line-height: 2px; background-color:'.$backgroundcolors[$counting].';font-family:arial;color:'.$fontcolors[$counting].';">\1</span>', $content); if($counting==$numbercolors){ $counting = 0; } else { $counting++; } } return $content; } ?> a simple usage $post_content = highlighter($search_words, $post_content); You can define the colors also, look at examples the demo or codes other forum post. I had css style in this at first in my included stylesheet, then modified the css class into the output themselves. Any time a css class met another class and was a hyperlink there.....it messed up the hyper, was still a pretty color though, so I redid it with good old depreciated basics of font.
  14. Since it seems you want to check the actual contents of the file if are the same maybe have to use preg_match() of the actual content. http://php.net/manual/en/function.preg-match.php You can probably first check if's the same filesize first, if same size then check contents against other similar sized contents using preg_match.
  15. You know........since php can control external devices as well....I think it's very possible!!!
  16. This could be useful as well http://nl3.php.net/manual/en/ref.pdf.php
  17. How about something like wordnet http://wordnet.princeton.edu/ I myself are keen to words. Take a look at artha, it uses wordnet http://artha.sourceforge.net/wiki/index.php/Home
  18. then you... echo "<a href='http://full/path/to/image' target='_blank'><img src='thumbnail/image.jpg' alt='my thumbnail' border='0'/></a>";
  19. And here is a slightly different version of function if need to explode from and make specific arrays. function highlighter($words, $content, $backgroundcolors=null, $fontcolors=null) { preg_match_all('~\w+~', $words, $matched); if(!$matched) { return $content; } $words = str_replace(array('+','-'), "", $words); $words = str_replace(" ", "|", $words); $words = trim($words); $words = explode("|", $words); if(is_null($backgroundcolors) || !is_array($backgroundcolors)) { $backgroundcolors = array('yellow', 'red', 'green', 'orange', 'aqua', 'lightskyblue ', 'pink', 'lime', 'fuchsia', 'maroon', 'navy', 'olive', 'purple', 'gray', 'silver', 'teal', 'grey'); if(is_null($fontcolors) || !is_array($fontcolors)) { $fontcolors = array('black', 'white', 'lime', 'oldlace');//change font colors or add more } } $counting = 0; $numbercolors = max(array_keys($backgroundcolors)); foreach ($words as $word) { $word = preg_quote(trim($word)); $content = preg_replace("/\b($word)\b/i", '<span style="background-color:'.$backgroundcolors[$counting].';font-family:arial;color:'.$fontcolors[$counting].';">\1</span>', $content); if($counting==$numbercolors){ $counting = 0; } else { $counting++; } } return $content; } ?>
  20. I completed the multi-word multi-color text highlighter. You can see a demo of the code here. http://dynaindex.com/color-highlighter.php Or can see it in use with my random url/search http://dynaindex.com/random-url.php The random works better with the filter set to off. Here's the code function <?php function highlighter($words, $content, $backgroundcolors=null, $fontcolors=null) { if ($words == '' || $words == null) { return $content; exit; } if(is_null($backgroundcolors) || !is_array($backgroundcolors)) { $backgroundcolors = array('yellow', 'red', 'green', 'orange', 'aqua', 'lightskyblue ', 'pink', 'lime', 'fuchsia', 'maroon', 'navy', 'olive', 'purple', 'gray', 'silver', 'teal', 'grey'); if(is_null($fontcolors) || !is_array($fontcolors)) { $fontcolors = array('black', 'white', 'lime', 'oldlace');//change font colors or add more } } $counting = 0; $numbercolors = max(array_keys($backgroundcolors)); foreach ($words as $word) { $word = preg_quote(str_replace(array('+','-'), '',trim($word))); $content = preg_replace("/\b($word)\b/i", '<span style="background-color:'.$backgroundcolors[$counting].';font-family:arial;color:'.$fontcolors[$counting].';">\1</span>', $content); if($counting==$numbercolors){ $counting = 0; } else { $counting++; } } return $content; } ?> Here's the usage <?php //example text $text_or_variable = "This is an example of a multi-color multi-word text highlighter. Is most useful for search words, but can be used also for categories, tags, or any word as well. I integrated the css style into output, is no need to add stylesheet or add code anywhere else. Because this is tailored for search results, I eliminated the + or - in the highlighter results, will just show the word.<br /> Let's try some example using just test to see the results:<br /> ?test test? test.com http://test.com mytest.com test@test.com test-testing<br /> The highlight colors follow the order and pattern of the word versus position colors in the arrays"; //example words $word_or_words = array('test','multi', 'search', 'code', 'operator', 'classic', 'word', 'show', 'try'); //this is the code to use the function, replace $word_or_words, $text_or_variable with your variables echo "<h1>Auto Colors</h1>"; $auto_colors = highlighter($word_or_words, $text_or_variable);//auto colors echo $auto_colors; echo "<h1>Defined Colors</h1>"; $defined_colors = highlighter($word_or_words, $text_or_variable, $backgroundcolors=array('gold','red','yellow', 'pink'), $fontcolors=array('fuchsia','greenyellow','black','white','lime'));//defined colors in arrays echo $defined_colors; ?>
  21. Well I'm missing something here, because when I log in all I see is my profile area and not any other questions or sections. I can't navigate to anywhere else on the site, can only keep asking new questions. Tried it in seamonkey and also firefox.
  22. I just tried this and it worked. <?php $product['title'] = 01; if (substr($product['title'], 0, 2) == "01"){ print "Earring";} ?>
  23. if (substr($product['title'], 0, 2) == "01"){ $variable = "do something with it"; } well you get the idea, can do what you need by checking the variable $variable_first_two = substr($variable, 0, 2);
  24. Might as well add this, Zimbra, is same client yahoo uses and free. http://www.turnkeylinux.org/zimbra That's a turnkey ready to go version, is also some other interesting ready made snapshots there as well.
  25. If wanted to do multiple virtual dedicated servers or any type of hosting, this is a very good complete package using openvz or xen. Needs centos as operating system for the server. I ran this a while and loved it, but I wasn't really hosting and had a need for the next php version at the time. Comes complete with email server, user control panels,ticket system and all, is very deluxe, especially when it's free. http://lxcenter.org/software/hypervm/ http://lxcenter.org/software/kloxo/ Used to be lxadmin
×
×
  • 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.