Guys, I know this is not a safecracker issue and have posted it on the EE forums with no response so far. If anything springs to mind I would be very grateful of the assistance.
I have a SAEF to publish match fixtures and I have a couple of selects that I want to limit the categories and channel entries being returned for particular members by using a custom member field.
I have used php to pull the member field
<?php
$league_category = '{exp:member:custom_profile_data}{league_category}{/exp:member:custom_profile_data}';
?>
For the categories the php code works fine and I am able to display the categories list that I need.
But to get the channel entries working in the first place I have had to use an embed, and I cannot get the php working to display the teams within the embed.
Main SAEF
{exp:safecracker channel="fixtures"
return="fixtures/thanks_row"
datepicker="no"
}
<fieldset>
<input type="hidden" name="allow_comments" value="n" />
<input type="hidden" name="status" value="Pending" />
<?php
$league_category = '{exp:member:custom_profile_data}{league_category}{/exp:member:custom_profile_data}';
?>
<table cellspacing="0">
<tr>
<td>
<input type="text" name="entry_date" id="entry_date" value="{current_time format='%Y-%m-%d %H:%i'}" maxlength="23" size="16" />
<input type="hidden" name="title" id="title" value="{title}" />
<select name="category[]">
<option value="" selected="selected">--</option>
{exp:channel:categories cache="yes" channel="seasons" refresh="60" style="linear"}
{if category_id == '<?php echo league_category?>' || parent_id == '<?php echo $league_category?>'}
{if parent_id=='0'}<optgroup label="{category_name}">
{if:else}<option value="{category_id}">{category_name}
{/if}
{if parent_id=='0'}</optgroup>
{if:else}</option>
{/if}
{/if}
{/exp:channel:categories}
</select>
{embed=fixtures/home_team} {embed=fixtures/away_team}
<button type="submit" name="submit">Submit</button>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</fieldset>
{/exp:safecracker}
Embed
<select name="fixture_home_team">
<option value="" selected="selected">--</option>
{exp:channel:entries channel="teams" dynamic="no" orderby="title" sort="asc" limit="200" category="<?php echo $league_category?>" disable="pagination|member_data|custom_fields|category_fields"}
<option value="{entry_id}">{title}</option>
{/exp:channel:entries}
</select>