Jump to content

Cheszy

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Cheszy's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, I want to have a "+" in my url, I'm working with a simple graphic cms, but I can't get it working. I've tried it this way: [m]'.trim(preg_replace('/[^a-z0-9()+._]/i', ' ', $selected)).'[/m] But I still get an invalid! url! example
  2. That's what I found too, but I need a code like: turns into: 45 minutes ago.
  3. When I post my updates, I just put the date (March 21, 2011). But I want to have it this way: 33 seconds, 4 minutes, 3 hours, 1 day, 2 days etc etc ago. So I post it in the code like 'March 21, 2011 02:35' and when it's 2:45, it says 10 minutes ago. I know you can do such a thing in a database, but I don't work with databases, so I want to "hand-add" it. But I don't know how. (Hope this is more clear) hahaha sorry!
  4. I'm looking for something that shows how long it's posted (30 seconds, 10 minutes, 1 hour, 2 hours, 1 day, 1 week, date) But I don't work with databases, so I hope there's something around like this without databases.
  5. I'm sorry
  6. It's a search script (adding links etc. with the hand)! <?PHP //### Maximum results per page $maxPerPage = 20; if(isSet($_GET['query']) && strlen($_GET['query']) >= 1 ) { include('connection.php'); //### Get and filter the search term entered $searchTerm = mysql_real_escape_string($_GET['query']); $searchTerm = explode(' ',$searchTerm); $termCount = 0; foreach($searchTerm AS $term) { $termCount++; if($termCount == 1) { $query .= " WHERE keywords LIKE '%$term%' "; } else { $query .= " OR keywords LIKE '%$term%' "; } } //### Count total results $totalResults = mysql_num_rows(mysql_query("SELECT * FROM search_links ".$query."")); if(!$totalResults) {echo 'We could not find any results to match your search query.'; exit; } //### Get inital starting point for records $start = isSet($_GET['s']) ? (int)$_GET['s'] : 0 ; if($start > $totalResults-1) { $start = $totalResults-1; } //### Configure the next a prev links to conform with result count $next = ($start+$maxPerPage)>=$totalResults ? $totalResults-1 : $start+$maxPerPage ; $prev = ($start-$maxPerPage)<0 ? 0 : $start-$maxPerPage ; //### Now we do the search for the results $doSearch = mysql_query("SELECT * FROM search_links ".$query." LIMIT $start,$maxPerPage"); echo '<title>avata.rs - Search: ',implode(' ',$searchTerm),'</title>'; if(mysql_num_rows($doSearch)) { echo 'Results for "<span class="result">',implode(' ',$searchTerm),'</span>".<br><br>'; while($result = mysql_fetch_assoc($doSearch)) { echo '<div class="results">'; echo '<span class="resulth"><a href="',$result['link'],'">',$result['title'],'</a></span> - <span class="resultd">',$result['description'],'</span><br>'; echo ''; echo '<span class="resultl">',$result['link'],''; echo '</div>'; } echo '<a href="search.php?query=',implode(' ',$searchTerm),'&s=',$prev,'"><<Previous</a> '; echo '<a href="search.php?query=',implode(' ',$searchTerm),'&s=',$next,'">Next>></a>'; } else { //### No results so we tell them and offer another search echo 'We could not find any results to match your search query.'; exit; } } else { header('Location: index.html'); exit; } ?>
  7. I tried it, but I'm not so good in PHP/MYSQL Nothing is working
  8. I've got search script, but when I add I'm I get I\'m. I've tried everything (' , ’ , etc..) but nothing works... Can anyone help me with it? Thanks!
×
×
  • 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.