1. Najpr si deklarujeme novú premennu fbweb v súbore administrator/components/com_k2/tables/k2user.php
na riadok 28 pridáme var $fbweb = null;
class TableK2User extends K2Table { var $id = null; var $userID = null; var $userName = null; var $gender = null; var $description = null; var $image = null; var $url = null; var $group = null; var $plugins = null; var $ip = null; var $hostname = null; var $notes = null; var $fbweb = null;//declare your new variables
2.Pridáme nasledujúci kód do súboru components/com_k2/templates/register.php
a components/com_k2/templates/profile.php
<tr> <td class="key"> <label for="fbweb">FB WEB</label> </td> <td> <input type="text" name="fbweb" id="fbweb" size="40" value="<?php echo $this->K2User->fbweb; ?>" class="inputbox required" maxlength="50" /> </td> </tr>
3. Upravíme súbor components\com_k2\models\itemlist.php Pridáme fbweb na riadok 774
function getUserProfile($id = NULL) { $db = JFactory::getDBO(); if (is_null($id)) $id = JRequest::getInt('id'); else $id = (int)$id; $query = "SELECT id, gender, description, image, url, `group`, plugins, fbweb FROM #__k2_users WHERE userID={$id}";//add fbweb $db->setQuery($query); $row = $db->loadObject(); return $row; }
4.Pridáme v databáze do tabulky t7sq9_k2_users (t7sq9 je prefix tabulky) stlpec fbweb.
5.Hotovo