Hi man,
i'am wondering how did you done "events and announcements" page.
I'am trying to do same thing. I try to change multilevel menu, but i stuck.
i've add and
note: I'am not good with PHP
I have few problems:
1. I'am not getting data from all pages (i'am getting content and pubDate only from one page and from others only title)
2. How can I get only few first characters from content.
Could you please help me?
i'am wondering how did you done "events and announcements" page.
I'am trying to do same thing. I try to change multilevel menu, but i stuck.
i've add
Code:
$pagesArray[$count]['content'] = $data->content;
Code:
$xml.="<content><![CDATA[".$page['content']."]]></content>";
note: I'am not good with PHP
I have few problems:
1. I'am not getting data from all pages (i'am getting content and pubDate only from one page and from others only title)
2. How can I get only few first characters from content.
Code:
function page_article($a='') {
if (!isset($a) || $a == '' || empty($a)) { $a = return_page_slug(); }
$data = simplexml_load_string(ye_olde_data());
$menu = $data->xpath('//*[parent="first-article"]'); /* Show only pages with this parent */
function article_sorting($a, $b) {
$c1=strcmp($a->menuOrder, $b->menuOrder);
if ($c1!=0) return $c1;
$c2=strcmp(strtolower(($a->menu!=""?$a->menu:$a->pubDate)), strtolower(($b->menu!=""?$b->menu:$b->pubDate)));
if ($c2!=0) return $c2;
$c3=strcmp($a->slug, $b->slug);
if ($c3!=0) return $c3;
}
usort($menu,"article_sorting");
if (count($menu) > 0) {
echo '<ul class="menu">';
foreach ($menu as $link) {
$prnt = count($data->xpath('//item[slug="'.$a.'"][parent="'.$link->slug.'"]'));
echo '<li'.("$link->slug"==$a?' class="active"':($prnt>0?' class="parent"':'')).'><a href="'.$link->url.'">'.($link->menu!=""?$link->menu:$link->title).'</a>';
echo '<br />';
echo ''.($link->menu!=""?$link->menu:$link->pubDate).'';
echo '<br /> <br />';
echo ''.($link->menu!=""?$link->menu:$link->content).'';
echo '</li>';
echo '<br /> <br />';
}
echo '</ul>';
}
}
Could you please help me?