$schedConf = Request::getSchedConf();
$schedConf->getSetting('closeCommentsDate');mcrider wrote:Tyler,
You can access data in the sched_conf_settings table by doing something like this:
- Code: Select all
$schedConf = Request::getSchedConf();
$schedConf->getSetting('closeCommentsDate');
...
function getContents() {
$schedConf = Request::getSchedConf();
$sponsors = $schedConf->getLocalizedSetting('sponsors');
print_r($sponsors); // prints nothing, but does when accessing other settings
return $sponsors;
}
...
<div class="block" id="sidebarSponsors" style="text-align:center">
<div class="blockTitle" id="sponsors">{translate key="about.sponsors"}</div>
</div>
<div class="block" id="sidebarSponsors" style="text-align:center">
<div class="blockTitle" id="sponsors">{translate key="about.sponsors"}
{foreach from=$sponsors item=sponsor}
{if $sponsor.institution}
{if $sponsor.url}
<li><a href="{$sponsor.url|escape}">{$sponsor.institution|escape}</a></li>
{else}
<li>{$sponsor.institution|escape}</li>
{/if}
{if $sponsor.logourl}
<li style="list-style-type:none"><a href="{$sponsor.url|escape}"><img src="{$sponsor.logourl|escape}"></a></li>
{/if}
{/if}
{/foreach}
</div>
</div> function getContents() {
$schedConf = Request::getSchedConf();
$sponsors = $schedConf->getSetting('sponsors');
//$templateMgr->assign('sponsors', $sponsors);
foreach ($sponsors as $sponsor)
if ($sponsor['logourl'])
$sponsorstrings = $sponsorstrings . '<a href="' . $sponsor['url'] . '"><img src="' . $sponsor['logourl'] . '" width="100%"></a><br>';
return $sponsorstrings;
}
function getContents() {
$schedConf =& Request::getSchedConf();
$sponsors = $schedConf->getSetting('sponsors');
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('sponsors', $sponsors);
return parent::getContents();
}asmecher wrote:I haven't tested this, but it should be OK.
- Code: Select all
return parent::getContents();
return parent::getContents($templateMgr);
...
function getContents(&$templateMgr) {
$schedConf = Request::getSchedConf();
$sponsors = $schedConf->getSetting('sponsors');
$templateMgr->assign_by_ref('sponsors', $sponsors);
return parent::getContents($templateMgr);
}
...
<div class="block" id="sidebarSponsors" style="text-align:center">
<div class="blockTitle" id="sponsors" style="text-align:center">{translate key="about.sponsors"}
{foreach from=$sponsors item=sponsor}
{if $sponsor.institution}
{if $sponsor.logourl}
<a href="{$sponsor.url|escape}"><img src="{$sponsor.logourl|escape}" width="100%"></a>
{else}
{if $sponsor.url}
<a href="{$sponsor.url|escape}">{$sponsor.institution|escape}</a>
{/if}
{/if}
{/if}
{/foreach}
</div>
</div>
Users browsing this forum: No registered users and 2 guests