Menu Content

Podpora

> Diskusní fóra, FAQs & placená podpora
Welcome, Guest
Username Password: Remember me

Profile for benchesters

  • OFFLINE
  • Time Zone: GMT +0:00
  • Local Time: 23:00
  • Posts: 5
  • Profile Views: 3180
  • Location: Unknown
  • Gender: Unknown
  • Birthdate: Unknown

Signature

Posts

Posts

emo
No problem, I was delighted when I found that code after hours of head scratching!
SEF Extension for K2 ...
Category: Extensions
emo
I am pretty sure I hacked the php via a post I managed to find on a website. Here's the note I sent to myself at the time:


REPLACE THIS FUNCTION IN THIS FILE:

/components/com_sef/sef_ext/com_k2.php

this now uses item alias AND strips out any dashes that appeared where apostrophes were! For example:

alias I specified was '80's videos'

this got changed to:

www.example.com/80-s-videos

This fix does this:

www.example.com/80s-videos

Here is the code:


function getItemTitle($id){

$database =& JFactory::getDBO();

if(preg_match('!:!', $id)) {

$idExplode = explode(':', $id);

$id = intval($id[0]);

};

$database->setQuery("SELECT `title`, `alias`, `catid` FROM `#__k2_items` WHERE `id` = $id");

$item = $database->loadObject();

$cat = $this->getCategoryTitle($item->catid);

$name = $item->alias;

array_push($cat, $name);

return $cat;

}
SEF Extension for K2 ...
Category: Extensions
emo
Does anyone know how to hack the php in this plugin so that it takes the item alias rather then the item name?
SEF Extension for K2 ...
Category: Extensions
More
Přihlášení uživatele Prázdný