This topic is locked
[SOLVED]

 menu item advanced

3/15/2014 12:13:40 PM
PHPRunner General questions
C
chrispa author

hi ,
i refer to that link
forum link
and actually use following script
if($menuItem->getLinkType() == 'Internal')

{

global $tables_data;

$table=$menuItem->getTable();

include_once(getabspath("include/".GetTableURL($table)."_settings.php"));

$table=GetOriginalTableName($table);
if (($table)==("tbltodo"))

{

$rs=CustomQuery("select count() as c1 from container where visible='Yes'" );

$data = db_fetch_array($rs);

$menuItem->setTitle($menuItem->getTitle() . " (". $data["c1"] . ")");

}
else

{

$rs=CustomQuery("select count(
) as c1 from " . AddTableWrappers($table));

$data = db_fetch_array($rs);

$menuItem->setTitle($menuItem->getTitle() . " (". $data["c1"] . ")");

}
}

return true;
i get following error
Fatal error: Call to undefined function GetOriginalTableName() in C:\xampp\htdocs\todo\include\events.php on line 82
can you help?
thanks

C
chrispa author 3/16/2014



hi ,
i refer to that link
forum link
and actually use following script
if($menuItem->getLinkType() == 'Internal')

{

global $tables_data;

$table=$menuItem->getTable();

include_once(getabspath("include/".GetTableURL($table)."_settings.php"));

$table=GetOriginalTableName($table);
if (($table)==("tbltodo"))

{

$rs=CustomQuery("select count() as c1 from container where visible='Yes'" );

$data = db_fetch_array($rs);

$menuItem->setTitle($menuItem->getTitle() . " (". $data["c1"] . ")");

}
else

{

$rs=CustomQuery("select count(
) as c1 from " . AddTableWrappers($table));

$data = db_fetch_array($rs);

$menuItem->setTitle($menuItem->getTitle() . " (". $data["c1"] . ")");

}
}

return true;
i get following error
Fatal error: Call to undefined function GetOriginalTableName() in C:\xampp\htdocs\todo\include\events.php on line 82
can you help?
thanks


i found that post which was very usefull and worked fine
link2
and now is working fine as below :
if($menuItem->getLinkType() == 'Internal')

{

global $tables_data;

$table=$menuItem->getTable();

include_once(getabspath("include/".GetTableURL($table)."_settings.php"));

$gSettings = new ProjectSettings($table, $menuItem->getPageType());

$table = $gSettings->GetOriginalTableName();
if (($table)==("tbltodo"))

{

$rs=CustomQuery("select count() as c1 from tbltodo where visible='Yes'" );

$data = db_fetch_array($rs);

$menuItem->setTitle($menuItem->getTitle() . " (". $data["c1"] . ")");

}

else

{

$rs=CustomQuery("select count(
) as c from " . AddTableWrappers($table));

$data = db_fetch_array($rs);

$menuItem->setTitle($menuItem->getTitle() . " (". $data["c"] . ")");

}
}

return true;
thanks anyway!