Joomla.it Forum
Componenti per Joomla! => Gestione utenti e community => : Mosevich 07 Jul 2008, 15:40:05
-
Come posso far si che un utente ( ovviamente registrato ) abbia la possibilità di scrivere articoli sul sito?
-
up
-
E' inutile uppare ogni 5 minuti.
Comunque basta che crei un pulsante nuovo selezionando l'opzione invia documento
ciao
-
E' inutile uppare ogni 5 minuti.
Comunque basta che crei un pulsante nuovo selezionando l'opzione invia documento
ciao
Sucusa,potresti spegarti meglio ?
-
l'utente deve essere MINIMO author, un normale utente registrato non può. Vai nella gestione MENU crei 1 nuova voce selezionando INVIA CONTENUTO ;)
-
l'utente deve essere MINIMO author, un normale utente registrato non può. Vai nella gestione MENU crei 1 nuova voce selezionando INVIA CONTENUTO ;)
Ah ecco ora ho capito ThX mille.. Solo una cosa per i vari gradi come Author Admin ecc... si possono modificare ? oppure si possono vedere i privilegi ?
-
Ciao,
puoi cambiare il gruppo di ogni utente dall'area amministrativa: Site --> User Manager --> clicchi sull'utente e poi si capisce.
Circa i privilegi:
- Author: può scrivere contenuti ma non può renderi visibili senza l'approvazione di un Publisher o un Admin
- Editor: può modificare i contenuti di chiunque ma non renderli visibili senza l'approvazione di un Publisher o un Admin
- Publisher: può modificare e rendere visibili i contenuti di tutti
Incredibilmente manca il gruppo di chi può modificare e rendere visibili senza approvazione solo i propri contenuti :(
In caso ti servisse c'è un plugin per CB per inserire tutti i nuovi registrati in un gruppo diverso da Registered. Si chiama EMGroupSelector - www.emcomponents.net
Ciao!
-
Sono riuscito a forzare il sistema di pubblicazione di Joomla!
Adesso gli autori possono pubblicare da soli i loro contenuti! E tutto senza alterare il codice di Joomla. Ho trovato come farlo cambiando il codice del componente mycontent. Le istruzioni sono qui: http://joomlicious.com/index.php?option=com_smf&Itemid=102&topic=146.0
Finalmente!
-
scusa l'ignoranza... ma dove lo trovo questo componente?
(l'inglese non lo mastico proprio bene, anzi .. )
-
extension.joomla.org
ciao
-
??? scusa ma continuo a non capire ...
è un componente? o che altro? ditemi voi. per favore
-
per far inviare un contenuto basta che crei un pulsante invia contenuto colegato al submit, altrimenti se vuoi impostare un grado diverso da author e utilizzi community builder puoi utilizzare il plugin segnalato da tachis
ciao
-
Sono riuscito a forzare il sistema di pubblicazione di Joomla!
Adesso gli autori possono pubblicare da soli i loro contenuti! E tutto senza alterare il codice di Joomla. Ho trovato come farlo cambiando il codice del componente mycontent. Le istruzioni sono qui: http://joomlicious.com/index.php?option=com_smf&Itemid=102&topic=146.0
Finalmente!
ma dove lo trovo il componente mycontent.. all'interno di /htdocs/components/ nn l'ho trovo...
ho trovato un com_content ma il file mycontent.php non riesco proprio a trovarlo.
io la versione joomla1.5
help?!
-
io ho questo nel file content.php
<?php
/**
* @version $Id: content.php 10381 2008-06-01 03:35:53Z pasamio $
* @package Joomla
* @subpackage Content
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant to the
* GNU General Public License, and as distributed it includes or is derivative
* of works licensed under the GNU General Public License or other free or open
* source software licenses. See COPYRIGHT.php for copyright notices and
* details.
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
// Require the com_content helper library
require_once(JPATH_COMPONENT.DS.'controller.php');
require_once(JPATH_COMPONENT.DS.'helpers'.DS.'query.php');
require_once(JPATH_COMPONENT.DS.'helpers'.DS.'route.php');
// Component Helper
jimport('joomla.application.component.helper');
// Create the controller
$controller = new ContentController();
// Register Extra tasks
$controller->registerTask( 'new' , 'edit' );
$controller->registerTask( 'apply', 'save' );
$controller->registerTask( 'apply_new', 'save' );
// Perform the Request task
$controller->execute(JRequest::getVar('task', null, 'default', 'cmd'));
$controller->redirect();
qualcuno sa dove devo mettere mani?
-
e in controller.php ho questo:
<?php
/**
* @version $Id: controller.php 10381 2008-06-01 03:35:53Z pasamio $
* @package Joomla
* @subpackage Content
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant to the
* GNU General Public License, and as distributed it includes or is derivative
* of works licensed under the GNU General Public License or other free or open
* source software licenses. See COPYRIGHT.php for copyright notices and
* details.
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die( 'Restricted access' );
jimport('joomla.application.component.controller');
/**
* Content Component Controller
*
* @package Joomla
* @subpackage Content
* @since 1.5
*/
class ContentController extends JController
{
/**
* Method to show an article as the main page display
*
* @access public
* @since 1.5
*/
function display()
{
JHTML::_('behavior.caption');
// Set a default view if none exists
if ( ! JRequest::getCmd( 'view' ) ) {
$default = JRequest::getInt('id') ? 'article' : 'frontpage';
JRequest::setVar('view', $default );
}
// View caching logic -- simple... are we logged in?
$user = &JFactory::getUser();
if ($user->get('id')) {
parent::display(false);
} else {
parent::display(true);
}
}
/**
* Edits an article
*
* @access public
* @since 1.5
*/
function edit()
{
$user =& JFactory::getUser();
// Create a user access object for the user
$access = new stdClass();
$access->canEdit = $user->authorize('com_content', 'edit', 'content', 'all');
$access->canEditOwn = $user->authorize('com_content', 'edit', 'content', 'own');
$access->canPublish = $user->authorize('com_content', 'publish', 'content', 'all');
// Create the view
$view = & $this->getView('article', 'html');
// Get/Create the model
$model = & $this->getModel('Article');
// new record
if (!($access->canEdit || $access->canEditOwn)) {
JError::raiseError( 403, JText::_("ALERTNOTAUTH") );
}
if( $model->get('id') > 1 && $user->get('gid') <= 19 && $model->get('created_by') != $user->id ) {
JError::raiseError( 403, JText::_("ALERTNOTAUTH") );
}
if ( $model->isCheckedOut($user->get('id')))
{
$msg = JText::sprintf('DESCBEINGEDITTED', JText::_('The item'), $model->get('title'));
$this->setRedirect(JRoute::_('index.php?view=article&id='.$model->get('id'), false), $msg);
return;
}
//Checkout the article
$model->checkout();
// Push the model into the view (as default)
$view->setModel($model, true);
// Set the layout
$view->setLayout('form');
// Display the view
$view->display();
}
/**
* Saves the content item an edit form submit
*
* @todo
*/
function save()
{
// Check for request forgeries
JRequest::checkToken() or jexit( 'Invalid Token' );
// Initialize variables
$db = & JFactory::getDBO();
$user = & JFactory::getUser();
$task = JRequest::getVar('task', null, 'default', 'cmd');
// Make sure you are logged in and have the necessary access rights
if ($user->get('gid') < 19) {
JError::raiseError( 403, JText::_('ALERTNOTAUTH') );
return;
}
// Create a user access object for the user
$access = new stdClass();
$access->canEdit = $user->authorize('com_content', 'edit', 'content', 'all');
$access->canEditOwn = $user->authorize('com_content', 'edit', 'content', 'own');
$access->canPublish = $user->authorize('com_content', 'publish', 'content', 'all');
if (!($access->canEdit || $access->canEditOwn)) {
JError::raiseError( 403, JText::_("ALERTNOTAUTH") );
}
//get data from the request
$model = $this->getModel('article');
//get data from request
$post = JRequest::get('post');
$post['text'] = JRequest::getVar('text', '', 'post', 'string', JREQUEST_ALLOWRAW);
//preform access checks
$isNew = ((int) $post['id'] < 1);
if ($model->store($post)) {
$msg = JText::_( 'Article Saved' );
if($isNew) {
$post['id'] = (int) $model->get('id');
}
} else {
$msg = JText::_( 'Error Saving Article' );
JError::raiseError( 500, $model->getError() );
}
// manage frontpage items
//TODO : Move this into a frontpage model
require_once (JPATH_ADMINISTRATOR.DS.'components'.DS.'com_frontpage'.DS.'tables'.DS.'frontpage.php');
$fp = new TableFrontPage($db);
if (JRequest::getVar('frontpage', false, '', 'boolean'))
{
// toggles go to first place
if (!$fp->load($post['id']))
{
// new entry
$query = 'INSERT INTO #__content_frontpage' .
' VALUES ( '.(int) $post['id'].', 1 )';
$db->setQuery($query);
if (!$db->query()) {
JError::raiseError( 500, $db->stderr());
}
$fp->ordering = 1;
}
}
else
{
// no frontpage mask
if (!$fp->delete($post['id'])) {
$msg .= $fp->stderr();
}
$fp->ordering = 0;
}
$fp->reorder();
$model->checkin();
// gets section name of item
$query = 'SELECT s.title' .
' FROM #__sections AS s' .
' WHERE s.scope = "content"' .
' AND s.id = ' . (int) $post['sectionid'];
$db->setQuery($query);
// gets category name of item
$section = $db->loadResult();
$query = 'SELECT c.title' .
' FROM #__categories AS c' .
' WHERE c.id = ' . (int) $post['catid'];
$db->setQuery($query);
$category = $db->loadResult();
if ($isNew)
{
// messaging for new items
require_once (JPATH_ADMINISTRATOR.DS.'components'.DS.'com_messages'.DS.'tables'.DS.'message.php');
// load language for messaging
$lang =& JFactory::getLanguage();
$lang->load('com_messages');
$query = 'SELECT id' .
' FROM #__users' .
' WHERE sendEmail = 1';
$db->setQuery($query);
$users = $db->loadResultArray();
foreach ($users as $user_id)
{
$msg = new TableMessage($db);
$msg->send($user->get('id'), $user_id, JText::_('New Item'), JText::sprintf('ON_NEW_CONTENT', $user->get('username'), $post['title'], $section, $category));
}
} else {
// If the article isn't new, then we need to clean the cache so that our changes appear realtime :)
$cache = &JFactory::getCache('com_content');
$cache->clean();
}
if ($access->canPublish)
{
// Publishers, admins, etc just get the stock msg
$msg = JText::_('Item successfully saved.');
}
else
{
$msg = $isNew ? JText::_('THANK_SUB') : JText::_('Item successfully saved.');
}
$link = JRequest::getString('referer', JURI::base(), 'post');
$this->setRedirect($link, $msg);
}
/**
* Cancels an edit article operation
*
* @access public
* @since 1.5
*/
function cancel()
{
// Initialize some variables
$db = & JFactory::getDBO();
$user = & JFactory::getUser();
// Get an article table object and bind post variabes to it [We don't need a full model here]
$article = & JTable::getInstance('content');
$article->bind(JRequest::get('post'));
if ($user->authorize('com_content', 'edit', 'content', 'all') || ($user->authorize('com_content', 'edit', 'content', 'own') && $article->created_by == $user->get('id'))) {
$article->checkin();
}
// If the task was edit or cancel, we go back to the content item
$referer = JRequest::getString('referer', JURI::base(), 'post');
$this->setRedirect($referer);
}
/**
* Rates an article
*
* @access public
* @since 1.5
*/
function vote()
{
$url = JRequest::getVar('url', '', 'default', 'string');
$rating = JRequest::getVar('user_rating', 0, '', 'int');
$id = JRequest::getVar('cid', 0, '', 'int');
// Get/Create the model
$model = & $this->getModel('Article' );
$model->setId($id);
if ($model->storeVote($rating)) {
$this->setRedirect($url, JText::_('Thanks for rating!'));
} else {
$this->setRedirect($url, JText::_('You already rated this article today!'));
}
}
/**
* Searches for an item by a key parameter
*
* @access public
* @since 1.5
*/
function findkey()
{
// Initialize variables
$db = & JFactory::getDBO();
$keyref = JRequest::getVar('keyref', null, 'default', 'cmd');
JRequest::setVar('keyref', $keyref);
// If no keyref left, throw 404
if( empty($keyref) === true ) {
JError::raiseError( 404, JText::_("Key Not Found") );
}
$keyref = $db->Quote( '%keyref='.$db->getEscaped( $keyref, true ).'%', false );
$query = 'SELECT id' .
' FROM #__content' .
' WHERE attribs LIKE '.$keyref;
$db->setQuery($query);
$id = (int) $db->loadResult();
if ($id > 0)
{
// Create the view
$view =& $this->getView('article', 'html');
// Get/Create the model
$model =& $this->getModel('Article' );
// Set the id of the article to display
$model->setId($id);
// Push the model into the view (as default)
$view->setModel($model, true);
// Display the view
$view->display();
}
else {
JError::raiseError( 404, JText::_( 'Key Not Found' ) );
}
}
/**
* Output the pagebreak dialog
*
* @access public
* @since 1.5
*/
function ins_pagebreak()
{
// Create the view
$view = & $this->getView('article', 'html');
// Set the layout
$view->setLayout('pagebreak');
// Display the view
$view->display();
}
}
-
per favore per favore... vi supplico.. aiutatemi
-
Ciao kamazura,
non trovi il componente mycontent perché devi installarlo.
Sta qui: http://extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,564/Itemid,35/
ma è solo per J! 1.0 e dicono che non sanno quando faranno uscire la versione per J! 1.5
Trovi il topic qui:
http://joomlicious.com/index.php?option=com_smf&Itemid=102&topic=256.0
Io non uso ancora J! 1.5 ma forse c'è già un modo per risolvere il problema senza mycontent?
Tachis
-
tutto chiaro.. :D
grazie
ora aspetto che esca per la 1.5 o che qualcuno mi aiuti a modificare il codice php.
ho provato a leggerlo ma non ci ho capito molto. voglio evitare di fare casino.
-
nessuno ha una soluzione a riguardo?
-
Ecco la soluzione per Joomla! 1.5
Bisogna modificare due file:
components\com_content\controller.php
components\com_content\models\article.php
Per il primo: commentare alcune righe intorno alla 229, come segue (occhio che una riga non va commentata):
// if ($access->canPublish)
// {
// Publishers, admins, etc just get the stock msg
$msg = JText::_('Item successfully saved.');
// }
// else
// {
// $msg = $isNew ? JText::_('THANK_SUB') : JText::_('Item successfully saved.');
// }
In questo modo non verrà scritto che l'articolo dovrà essere approvato.
Per il secondo file: cambiare 0 in 1 all'incirca alla riga 332
// For new items - author is not allowed to publish - prevent them from doing so
$article->state = 1;
E il gioco è fatto!
Crediti
Ho solo tradotto questo topic: http://forum.joomla.org/viewtopic.php?p=1645742