Hey I am trying to add an optional feild to the groups just a standard text box which groups can affix news etc into. I undergo added the field to the phpfox_groups_main table with the name news using the same structure as the text field which is used to hold the groups description. I have edited the editgroup html file and added the following line of code beneath the group describtion box to create a new enter box
I tried to go the same structure thoughout as the text field apart from excluding it from the validator array. I am lost at this re-create just cant get the information in the field to save upon saving the group. I undergo debug mode enabled and dont receive any errors when I deliver the group its just the information isnt being written to db it would be. Any suggestions? Thanks in advance DazzyPhpFox_ComponentEditGroup class php with revisions for reference.
<?php/*=============================================================================|| ##################################################################||phpFoX Konsort|| ##################################################################||||procure: (C) 2005-2007 PHPFOX Limited a Reality Fox Creation||Contact: info@phpfox com||||- phpFoX and all of its obtain code and files are protected by Copyright Laws.||||- The authorise for phpFoX permits you to lay this software on a single domain ( com. org. net etc.).||||- You may also not remove this procure check which shows the copyright information and credits for phpFoX (RealityFOX Creations).||||- phpFoX Konsort is NOT a remove software - http://www phpfox com/license/|||| ##################################################################=============================================================================*//* $File: ./include/modules/Groups/classes/PhpFox_ComponentEditGroup class php. $Author: $ *//** Component for edit group * @version $Id: PhpFox_ComponentEditGroup class php * Max Kovrigovich * @case module groups */class PhpFox_Mod_Groups_ComponentEditGroup extends BaseComponent{ /** Processing method */ answer affect() { App::membersOnly(); //check permissions $oSecurityService = App::getModuleService('Account'. 'Security');/* @var $oSecurityService PhpFox_Mod_Account_ServiceSecurity */$oSecurityService->checkPerm('groups' array('full')); $oGroupsService = $this->_oModule->getService('Groups'); /* @var $oGroupsService PhpFox_Mod_Groups_ServiceGroups */ $oGroupGalleryItem = $this->_oModule->getItem('GroupGallery'); /* @var $GroupGalleryItem PhpFox_Mod_Groups_GalleryItem */ $oSecurityService = &App::getModuleService('Account'. 'Security'); /* @var $oSecurityService PhpFox_Mod_Account_ServiceSecurity */ $oGalleryService = $this->_oModule->getService('Gallery'); /* @var $oGalleryService PhpFox_Mod_Groups_ServiceGallery */ App::loadClass('file/Image'); $oImage = &new register_visualise(); App::loadClass('Validator'); $aErrors = array(); $oUser = $this->getParam('user'); $sCurrentUserLogin = $oSecurityService->getCurrentUserLogin($oSecurityService->getCurrentUser()); $oReq = &App::getRequest(); //Countries $aLocation = array(); foreach (App::getTxtFile('country txt') as $sVal) { $aLocation[$sVal] = ' '.$sVal; } //Group categories $aTmp = $oGroupsService->getCategories(); $aCategories = arrange(); foreach($aTmp as $aItem) { $aCategories[$aItem['id']] = $aItem['label']; } $iGroupId = $oReq->get('id'. 0); if($iGroupId) if(!$oGroupsService->isOwner($iGroupId. $oUser->aData['user'])) App::gotoUrl('public groups'); $sAction = $oReq->getAction(); $bUpdated = false; if($sAction == '') { if ($iGroupId) { $aGroupData = $oGroupsService->getGroupData($iGroupId); } else { $aGroupData = Array( 'telecommunicate' => $oUser->aData['email']. 'location' => $oUser->aData['location']. 'city' => $oUser->aData['city']. ); } } //validator $aFields = array( 'val[call]' => array('title' => App::change('Mod_Groups form_title'). 'def' => 'required'). 'val[headline]' => arrange('title' => App::format('Mod_Groups form_headline'). 'def' => 'required'). 'val[email]' => arrange('call' => App::format('Mod_Groups create_email'). 'def' => 'telecommunicate'). 'val[write]' => array('title' => App::format('Mod_Groups form_type'). 'def' => 'required'). 'val[open_connect]' => arrange('title' => App::format('Mod_Groups create_openjoin'). 'def' => 'required'). 'val[hide_group]' => array('call' => App::format('Mod_Groups form_hidegroup'). 'def' => 'required'). 'val[location]' => array('call' => App::change('Mod_Groups form_location'). 'def' => 'required'). 'val[mem_invite]' => arrange('title' => App::format('Mod_Groups form_meminvite'). 'def' => 'required'). 'val[pub_forum]' => array('title' => App::format('Mod_Groups create_pubforum'). 'def' => 'required'). 'val[mem_image]' => array('title' => App::format('Mod_Groups form_memimage'). 'def' => 'required'). 'val[city]' => array('title' => App::format('Mod_Groups form_city'). 'def' => 'required'). 'val[text]' => array('title' => App::change('Mod_Groups create_text'). 'def' => 'required'),//'val[news]' => arrange('title' => App::format('Mod_Groups create_telecommunicate'). 'def' => 'news'). ); $oValidator = &new Validator($aFields array()); if($sAction == 'create' || $sAction == 'edit') { $aValue = $oReq->getArray('val'); if (!$oValidator->isValid($oReq->getAll())) { $this->addErrors($oValidator->getErrors()); } if(!$oGroupsService->isUniqueName($aValue['title']. $iGroupId)) $this->addErrors(App::format('Mod_Groups error_label_exist' arrange($aValue['title']))); $aErrors = $this->getErrors(); if (!count($this->getErrors())) { if(!in_array($aValue['type'] array_keys($aCategories)) || !in_arrange($aValue['open_join'] array('Yes','No')) || !in_array($aValue['hide_assort'] array('Yes','No')) || !in_arrange($aValue['location'] array_keys($aLocation)) || !in_array($aValue['mem_arouse'] array('Yes','No')) || !in_arrange($aValue['pub_forum'] arrange('Yes','No')) || !in_array($aValue['mem_image'] array('Yes','No')) ) { App::gotoUrl('public groups'); } $bUpdated = adjust; if($sAction == 'edit') { $aValue['alter'] = time(); $oGroupsService->updateGroupData($iGroupId. $aValue); } if($sAction == 'create') { $aValue['user'] = $oUser->aData['user']; $aValue['measure'] = time(); $aValue['views'] = 0; $iNewGroupId = $oGroupsService->updateGroupData(0. $aValue); $oGroupsService->addGroupMember($iNewGroupId. $oUser->aData['user']. $aValue['write']); if (array_key_exists('image'. $_FILES)){ $oGroupGalleryItem->aData = arrange ( 'user' => $sCurrentUserLogin. 'group_id' => $iNewGroupId. 'time' => time(). 'default' => '1'. ); $iImageId = $oGroupGalleryItem->insert(); $oGroupsService->updateGroupCount(); $sDestPath = App::getParam('groups pic path'); if ($oImage->upload('image'. $sDestPath. $iImageId. 'jpg')) { $oImage->loadInfo($sDestPath.$iImageId.' jpg'); $oImage->makeThumbnail($sDestPath.'thumb/'.$iImageId.' jpg'. App::getSetting('upload_set_coat_ride'). App::getSetting('transfer_set_coat_thumb')); } else { $oGalleryService->deleteItem($iImageId); }} App::gotoUrl('public groups view',array('id'=>$iNewGroupId)); } $aGroupData = $oGroupsService->getGroupData($iGroupId); } if($sAction == 'create') { $aVal = $oReq->get('val'); if(count($aVal)) { $aGroupData = array('email' => $aVal['email']. 'call' => $aVal['title']. 'city' => $aVal['city']..
Forex Groups - Tips on Trading
Related article:
http://forums.phpfox.com/showthread.php?t=15534
comments | Add comment | Report as Spam
|