/** * * @param string $str * @return string */ function tagLink($str) { return baseUrl(str_replace('{tag}', seoLinks($str, TRUE), Route::get_config('tagLink', 'route'))); }
/** * * @param string $query Default NULL * @param int $total * @return void */ public function saveTags($query = NULL, $total) { if ($query == NULL or $total < 1) { return; } if (!Config::get('save', 'tags')) { return; } if (strlen(seoLinks($query, TRUE)) < Config::get('minCharLimit', 'tags')) { return; } if ($total < Config::get('minResultsLimit', 'tags')) { return; } $query = str_replace('-', ' ', seoLinks($query, TRUE)); DB::select('tag'); DB::from('tag'); DB::where(array('tag' => $query)); DB::limit(1); DB::run(); $getTag = DB::getVar(); if ($getTag) { return; } DB::insert('tag', array('tag' => $query)); }