thanks for the comment.
Sounds like a cool feature and it shouldn't be too difficult.
in ..mod_exdata/inc_front/func.inc.php
Code: Select all
find:
function gatherExd($cat, $main_template_file, $event_template_file) {
replace with:
function gatherExd($cat, $main_template_file, $event_template_file, $fieldnr) {
find:
$exd_entries = $exd->make_entries($cat, $date, $event_template_file);
replace with:
$exd_entries = $exd->make_entries($cat, $date, $event_template_file, $fieldnr);
find:
if( ! ( strpos($content["all"],'{EXDATA')===false ) ) {
$content["all"] = preg_replace('/\{EXDATA:(.+?):(.+?):(.+?)\}/ei', "gatherExd(\"\$1\", \"\$2\", \"\$3\")" , $content["all"]);
}
replace with:
if( ! ( strpos($content["all"],'{EXDATA')===false ) ) {
$content["all"] = preg_replace('/\{EXDATA:(.+?):(.+?):(.+?)\}/ei', "gatherExd(\"\$1\", \"\$2\", \"\$3\", \"0\")" , $content["all"]);
}
if( ! ( strpos($content["all"],'{FIELDDATA')===false ) ) {
$content["all"] = preg_replace('/\{FIELDDATA:(.+?):(.+?):(.+?):(.+?)\}/ei', "gatherExd(\"\$1\", \"\$2\", \"\$3\", \"\$4\")" , $content["all"]);
}
Code: Select all
find:
function make_entries($cat, $date, $template=0){
replace with:
function make_entries($cat, $date, $template=0, $fieldnr=0){
find:
$event = file_get_contents(PHPWCMS_ROOT."/include/inc_module/mod_exdata/inc_front/templates/".$template);
add after:
if (!$fieldnr == 0) {
$y=$fieldnr;
$z=$fieldnr;
} else {
$y=1;
$z=8;
}
find:
for ($j = 1; $j <= 8; $j++) {
replace with:
for ($j = $y; $j <= $z; $j++) {
find:
$events = "<div>No Entries in this Category!</div>\n";
add after:
for ($m = 1; $m <= 8; $m++) {
$events = str_replace("{TF".$m."}", "", $events);
$events = str_replace("{EF".$m."}", "", $events);
}
{FIELDDATA:category#:front.template.php:?.entry.template.php:field#}
make sure you don't have ' ' in your template, because this will show empty lines!
does this help? even if it is not the cleanest code i've ever written