Your browser does not support our blog javascript

field support software

search for more blogs here

 
Home - Take this blog! - Get your Author's Pass Here - Submit Comments Below

Adding an additional field to groups

Posted by ~Ray @ 2007-11-22 01:53:07


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']..[ADVERTHERE]Related article:
http://forums.phpfox.com/showthread.php?t=15534


0 Comments:


No comments have been posted yet!

From:   Website:
Subject:   Code:
Message:


   

 


 

 

 





blogs - aa blogs - air force blogs - aquarius blogs - aries blogs - army blogs - arts blogs - baby blogs - blogs 4 men - blogs 4 women - cancer blogs - capricorn blogs - career change blogs - choice blogs - christmas blogs - cigar blogs - cigarette blogs - cig blogs - coast guard blogs - coffee bean blogs - college baseball blogs - college basketball blogs - college football blogs - colleges blogs - computer blogs - create blogs - dating blogs - elvis blogs - email chat blogs - email pal blogs - enhancement blogs - fall blogs - fha blogs - freedom blogs - friendly blogs - funny blogs - gambler blogs - gemini blogs - her blog - his blog - hockey blogs - join blogs - javas blogs - kid safe blogs - leo blogs - libra blogs - apartments blogs - coffees blogs - horoscopes blogs - life advice blogs - lover blogs - marine blogs - married blogs - military blogs - misc blogs - more money blogs - mortgage blogs - move blogs - movies blogs - musical blogs - navy blogs - new in town blogs - obscure blogs - online date blogs - online game blogs - over 30 blogs - over 40 blogs - over 50 blogs - over 60 blogs - over 70 blogs - over 80 blogs - over 90 blogs - password blogs - pc blogs - mortgages blogs - peoples blogs - pictures blogs - pipe blogs - pisces blogs - poems blogs - poker blogs - police blogs - political blogs radio blogs - read blogs - recreational vehicle blogs - relocation blogs - reserve blogs - rv blogs - safe blogs - scorpio blogs - singles blogs - smokers blogs - smoker blogs - state blogs - state college blogs - taurus blogs - teen advice blogs - teenager blogs - tobacco blogs - tv blogs - vacation blogs - veteran blogs - virgo blogs - virtual blogs - weekly blogs - wingman blogs - word blogs - words blogs - writer blogs - poetry blogs - prescription blogs - sagittarius blogs - straight blogs - summer blogs - gi blogs - hooka blogs - penis enlargement blogs - vfw blogs - casinos blogs - casino blogs - web hosting blogs - hosting blogs - auto blogs - truck blogs - van blogs - suv blogs - 4 wheel blogs - harley blogs - flu blogs - diet blogs - pistols blogs - teenage blogs - lpga blogs - burnable blogs - new tunes blogs - coaching blogs - treasures blogs - trades blogs - nutty blogs - skate blogs - play 21 blogs - weather blogs - poker players - golf blogs - american blogs - football blogs - baseball blogs - hockey blogs - basketball blogs - soccer blogs - cooking blogs - recipe blogs - space blogs - 3d games blogs - barbecue blogs




blogs home