• Increase font size
  • Default font size
  • Decrease font size
Home SOBI2-demo Různě Úrovně přístupů uživatelů

Rámečky jsou schválně ponechány viditelné, abyste viděli rozsah tabulek a divů, nejde o to ukázat design, ale možnosti a funkce SOBI2

Úrovně přístupů uživatelů

Omezení - úrovně přístupů uživatelů

sobi2.vc.tmpl: Ne
sobi2.details.tmpl: Ne
sobi2.form.tmpl: Ano
Originál otázka-EN:

For example is it possible to have registered user 1 entry while giving editors 5 entries limit?

Originál odpověď-EN:

I was able to setup one client to offer different types of Entries limits. So 3 Entries Free and paid thereafter and other types of Entries always free. However, this functionality is not a core MET-Pro feature it was custom development (It's just easier to add with MET).

To do this all you really need is to modify your Entry Template.
Add a script to the top of the Entry template to Compare number of Entries for a user with their user level.

Not that it has any bearing on this but I assume you are using an AEC solution presently.

Script would look like this, it would be followed with the rest of your Entry Template

This will check the existing entries for a user and if they have reached their limit it will send them back to another screen. I Set it to just go back to the main Sobi2 screen, but maybe a Sales Screen so they can buy up their user level would be a good choice to

Have Fun, and let everyone know if it works.



<!-- ====start====Omezeno úrovně přístupu uživatelů================= greg-->
/* Configuration */
/* These are the limits by User type, format is 'usertype' => <Max # of Entries>, (no , for last one) */
$limitChks = array (
'Registered' => 5,
'Editor' => 5,
'Administrator' => 999,
'Super Administrator' => 99999
/* This is the Message for when the User tries to add an Entry at Limit */
$OverlimitMSG = "You have reached your limit for Entries";
/* This is where they are sent, currently should be main Sobi2 page */
$RedirectTo = "index.php?option=com_sobi2";

/* End of Configuration */

/* Actual Code of Process */

$config =& sobi2Config::getInstance();
$database =& $config->getDb();
$user =& JFactory::getUser(); // Get user's general details
/* See How Many Free Entries are setup so far */
$query = "SELECT count(*) FROM #__sobi2_item WHERE owner = '{$user->id}';";
$entryCount = $database->loadResult();
if ($entryCount >= $limitChks[$user->usertype] && sobi2Config::request($_REQUEST, 'sobi2Task', null ) == 'addNew'){
sobi2Config::redirect( $RedirectTo , $OverlimitMSG );
// Entry Template follows this point

<!-- ====konec====Omezeno úrovně přístupu uživatelů================= greg-->

Autor kódu: Greg
Zdroj kódu: SOBI2
Originál link: Originál link
Autor-Web: http://www.betwixted.com/
Hlasovat: Ne
Gold: Ne
Platinum: Ne
Sponzor: Ne
Smart: Ne
Člen: Ne
Typ nabídky:
  • zdarma

Video: Ne
Pole pro registrované

Pole pro registrované uživatele dle úrovní

Rate now:  


Přidáno dne: 17.7.2011  Počet zobrazení: 591
Powered by Sigsiu.NET RSS Feeds

Chcete pro každého zákazníka jeho profil, formulář a typ inzerátu?

© 2008-2011 Copyright
www.stavosmart.cz www.okoloprahy.cz www.prodej-bytu.net www.prodej-pozemku.net www.gorange.cz