cmackie said:
Regarding the subject of Physics, I am currently reading "The Trouble With Physics" which I thoroughly recommend.
I'll definitely check that book out. Lee Smolin wrote it in 2006, on string theory among other subjects.
I always thought quantum possibility is a void housing infinite realities.
cmackie said:
Thanks Elshara!
You tell me to use radio buttons but this scroll down menu is responsible for the wiring for a lot of the forums in my site. I cannot disturb what has been built. I need to find where it is located and fix this issue.
You say: A find and replace command using Em Editor would be the fastest way on a computer to make the text appear.
Where can I find Em Editor?
You say: your other option is to look in the settings of your custom plugin to see if there's an option to tweak to show default text for the category system
I do not know which plug in was used for this feature. See screenshot of my plugins below.
Thanks!
In regards to your screenshot and Elshara, he is blind. Would you please post him a list so his screenreader can read it?Thank you.
Thanks Donna, I will type out the list by hand when I get a moment.
I downloaded ultra edit (instead of em editor) because I am on a mac. It will only open files (not folders) and I don't know what file the text is in. See Screen Shot 2019-04-03 at 4.56.37 pm. I assume we are trying to find the question "In which district are you eligible to vote?" Am I correct?
Plugins (from admin control panel):
Cecilia custom Work
Events
Groups
SES - Advanced nested comments with attachments
SES - Advanced News and Activity Feeds
SES - Basic Required
SES - Discussions
SES - Page Building and SHortcodes
Tom Friend
Ok I've managed to achieve this.
On the profile sign up page, you want to choose selection box www.yourdomain.com/admin/user/fields
in the settings, you can make this a required question
https://gyazo.com/9f8b69252149fea7d53a3523af7573c8
and that's it, done.
on the drop down you can see that the top option is blank, a user cannot leave it blank as its a required field.
Thanks Peppa! I can see this is available as a profile field but this question is on the sign up page.
To Everyone:
My developers have finally given me the code they used to place it there. I hope this will help us to fix the problem!
Districts:
File Path: /public_html/application/modules/User/Form/Signup/Account.php (approx line: 289)
$categories = Engine_Api::_()->getDbtable('categories', 'cecustom')->getCategoriesAssoc();
if( count($categories) > 0 ) {
$this->addElement('Select', 'category_id', array(
'label' => 'In which district are you eligible to vote?',
'multiOptions' => $categories,
));
}
For Edit Section here: https://werunthehouse.org/cecustom/edit/district
in engine4_users -> (Field Namecategory_id
File Path: /public_html/application/modules/Cecustom/Form/Edit/District.php
This contains:
<?php
class Cecustom_Form_Edit_District extends Engine_Form
{
public function init()
{
$this->setTitle("Edit District");
//SES Custom Work
$categories = Engine_Api::_()->getDbtable('categories', 'cecustom')->getCategoriesAssoc();
if( count($categories) > 0 ) {
$this->addElement('Select', 'category_id', array(
'label' => 'In which district are you eligible to vote?',
'multiOptions' => $categories,
));
}
//SES Custom Work
looks like its getting the information from the table 'engine4_users'
this is the data structure of mine
you should be looking for 'catergory_name' , as you can see mine doesnt have that as you have had custom tables added.
find that table and let us know whats in it.
It is category_id. I have taken a screenshot below. It has numbers assigned. So far they are 0, 6, 11 and 12.
hard to tell.
you have potentially 8 id numbers even though it goes up to 12, does at least every category you can choose from you drop down have atleast 1 user who has selected it ?
I can add as many categories as I want. I will be adding 435 districts which will add to 435 numbers in the category_id column in the table. I add them in the admin control panel at a location shown below. Don't lose sight of the goal here. I need to make the scroll down menu default setting "no response" so that if I make it a required question people must choose a district or none but they cannot leave the answer on "no response."
Firstly I'm not losing sight of the goal. I'm trying to understand how your custom plugin works.
Secondly, the reason behind my asking is whilst trying to understand your plugin there is a very good chance that a category id is unique and nonreusable
district 1 = id1
district 2 = id2
district 3 = id3
Now if you deleted district 2 because of a spelling error and recreated it you could have the following
district 1 = id1
district 2 = id4
district 3 = id3
This isn't uncommon.
Seeing as you were able to get the code snippet from the people who built this for you they should be the ones who should be able to fix this also.
You need to find out what/if the "none" option holds as an id if at all, if it does then you would need to remove that id from the database structure. If it doesn't have an ID then it's likely hard-coded into your code and the snippet presented earlier only shows the code getting formation from the database.
To test whether or not it does have an ID use your own account, select a district and go to your database, find your account and see which id you have selected
then go back and select the none option and see what the id is hopefully, it will have changed and you will see that it has an id.
A lot of this is guesswork as we don't know what the custom code looks like in its entirety.
Sorry, I haven't been much in touch, been rather busy.
By the looks of it is a 3rd party plugin or module you are using, unfortunate I do not know where the files and data are stored.
I had a look at the images you shared of the tables they look good to me, nothing wrong for the standard SEPHP without 3rd party modules.
Where you have to look, look at the source files of the plugin:
Make a backup copy of the file(s)
Download the files, and open them up with Notepad.
Somewhere in the file, you will find a bit of code linking to the 'Question'.
What I think is:
This is where you have to look.
Please note: all index numbers are unique in all tables of the database, if you delete a record with an index manually from the DB, this index number is no more available and the relations are no longer available by the software.
Software wise: You can only add to the database whereby the numbers increase.
Deleting software wise: It deletes the record but doesn't re-arrange the indexes so it starts with 0 again (1 in human language), that is why you have gaps in between index numbers as they are unique.
Maurits: You say I have to look at the source files of the plug in. Do you have any idea what plugin is being used here? My plugins are shown in an image I uploaded above.
Peppa: I signed in as a new user and selected "none." Then I checked the category_id of this new user and the value was 0.
@cmackie
The other way of doing this is ad an option 'required' in the HTML and rename the first record in the table to 'Please select from the list below'.
This way you have a required field with a category_id=Nothing which is not accepted.
https://werunthehouse.org/cecustom/edit/district
1.) You have to edit the first record in the table where it says 'None' to 'Please select from the list below'.
2.) You have to find the HTML form code and add 'required' to one line of code. See the blue line in the image.
The result after adding 'required' to the line above is:
It will work without editing the database record. Only adding one word 'required' to the line of code you get a result.
This is a quick fix for the solution with an [option value='None']
I am not familiar with this customer 3rd party software, so you have to find the HTML source.
Please note: this will be overwritten if you install an module update of your 3rd party
Thanks Maurits! I will ask where the HTML code is and get back to you.
Maurits,
The code I sent you may not be from the right place. The question appears to have code associated with it in several places. Here is the first place:
There is are a button on sign up which asks "in which district are you eligible to vote". The answer to this is assigned to "category_id" in the database under engine4_users . The code that makes this assignment is here:
File Path: /public_html/application/modules/Cecustom/controllers/EditController.php
<?php
class Cecustom_EditController extends Core_Controller_Action_User
{
public function init()
{
if (!Engine_Api::_()->core()->hasSubject()) {
// Can specifiy custom id
$id = $this->_getParam('id', null);
$subject = null;
if (null === $id) {
$subject = Engine_Api::_()->user()->getViewer();
Engine_Api::_()->core()->setSubject($subject);
} else {
$subject = Engine_Api::_()->getItem('user', $id);
Engine_Api::_()->core()->setSubject($subject);
}
}
if (!empty($id)) {
$params = array('id' => $id);
} else {
$params = array();
}
// Set up navigation
$this->view->navigation = $navigation = Engine_Api::_()
->getApi('menus', 'core')
->getNavigation('user_edit', array('params' => $params));
// Set up require's
$this->_helper->requireUser();
$this->_helper->requireSubject('user');
$this->_helper->requireAuth()->setAuthParams(
null,
null,
'edit'
);
}
public function districtAction()
{
$this->view->user = $user = Engine_Api::_()->core()->getSubject();
$this->view->viewer = $viewer = Engine_Api::_()->user()->getViewer();
// Get form
$this->view->form = $form = new Cecustom_Form_Edit_District();
// // Get current row
// $table = Engine_Api::_()->getDbtable('styles', 'core');
// $select = $table->select()
// ->where('type = ?', $user->getType())
// ->where('id = ?', $user->getIdentity())
// ->limit();
//
// $row = $table->fetchRow($select);
// Not posting, populate
if (!$this->getRequest()->isPost()) {
$form->populate(array(
'category_id' => (null === $user ? '' : $user->category_id)
));
return;
}
// Whoops, form was not valid
if (!$form->isValid($this->getRequest()->getPost())) {
return;
}
// Cool! Process
$category_id = $form->getValue('category_id');
$user->category_id = $category_id;
$user->save();
$form->addNotice(Zend_Registry::get('Zend_Translate')->_('Your changes have been saved.'));
}
}
But there is also code related to the question here:
File Path: /public_html/application/modules/User/Form/Signup/Account.php (approx line: 289)
$categories = Engine_Api::_()->getDbtable('categories', 'cecustom')->getCategoriesAssoc();
if( count($categories) > 0 ) {
$this->addElement('Select', 'category_id', array(
'label' => 'In which district are you eligible to vote?',
'multiOptions' => $categories,
));
}
Also:
File Path: /public_html/application/modules/Cecustom/Form/Edit/District.php
<?php
class Cecustom_Form_Edit_District extends Engine_Form
{
public function init()
{
$this->setTitle("Edit District");
//SES Custom Work
$categories = Engine_Api::_()->getDbtable('categories', 'cecustom')->getCategoriesAssoc();
if( count($categories) > 0 ) {
$this->addElement('Select', 'category_id', array(
'label' => 'In which district are you eligible to vote?',
'multiOptions' => $categories,
));
}
Where in this code do I add what you suggested?