Beispiel #1
0
 /**
  * Front end:: This function gives formatted vanity url
  * @param Title :: storeTitle
  * @param $oldstore_id :: $oldstore_id (on edit used to compare with old store id)
  * */
 function formatttedTitle($title, $oldstore_id = '')
 {
     $db = JFactory::getDBO();
     $quick2cartModelVendor = new quick2cartModelVendor();
     $user = JFactory::getUser();
     $i = 1;
     $final_title = $title;
     do {
         if ($i == 1) {
             $status = $quick2cartModelVendor->ckUniqueStoretitle($title, $oldstore_id);
         } else {
             $final_title = $title . $i;
             $status = $quick2cartModelVendor->ckUniqueStoretitle($final_title);
         }
         // generate new vanity url
         $i++;
     } while ($status != 0);
     return $db->escape(trim($final_title), true);
 }