how to get current site acat_id?

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
Florian
Posts: 119
Joined: Wed 19. Nov 2003, 16:50
Location: Hamburg
Contact:

how to get current site acat_id?

Post by Florian »

Hello together!

I've got a little problem.
I need to give out the current acat_id from the phpwcms_articlecat table (from the served site like $content["struck"]["acat_id"] = '8').
I allready var_dumped every possible variable, but I haven't found the right one yet. I get only the whole "site tree". Thats not what I need.
Can anyone help quickly, pleeeeeeaaaase I'm in a hurry. 8)

Thx a'lt and Cheers,
Florian
User avatar
Oliver Georgi
Site Admin
Posts: 9919
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

try this one please $content["cat_id"].
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Florian
Posts: 119
Joined: Wed 19. Nov 2003, 16:50
Location: Hamburg
Contact:

Post by Florian »

seems to be working in the right way... will post if it don't.

Cheers,
Florian
User avatar
Oliver Georgi
Site Admin
Posts: 9919
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

I have also created a reworked {NAV_TABLE_COLUMN} that can now handle different starting points -> used like this {NAV_TABLE_COLUMN:5}

But I have one little problem with that function - it must give a start count based on which level it it - default is 0 next 1 and so on. Because only then the nav table is rendered well.

I have realized an language chooser with that. But Level one is not visible.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Florian
Posts: 119
Joined: Wed 19. Nov 2003, 16:50
Location: Hamburg
Contact:

Post by Florian »

Ok, thanks for your replys. I needed the id for the dynamic SSL encryption, wich I've mailed to you.
With the {NAV_TABLE_COLUMN:5} problem is maybe a workaround, to build the structure recursive. So let the script search for the lowest level and and then one higer and so on until you reaches the root. So you don't have to count with i++ for it. See the example below, thats how I build it together with a friend at my interrims CMS for the firm:

Code: Select all

// Laden der Verfügaren Seiten
$query = "SELECT * FROM pages WHERE vis='1' ORDER BY sort ASC";
$result = mysql_query($query);
// In diesen Array kommen statische Seiten
$_static = array();
// In diesen dynamische
$_dynamic = array();
// Hier kommen sie alle einmal rein
$_all = array();
// DIese beiden Arrays brauche ich für den Pagetree
$tree = array();
$tree_r = array();
$rootpage = "";

// SQL Abfrage auswerten....
while ($tmp = mysql_fetch_array($result)) {
	$_all[] = $tmp["site"];
	// Typ feststellen und entspr. Speichern.
	if ($tmp["type"] == "static") 	$_static[] = $tmp["site"];
	else 	$_dynamic[] = $tmp["site"];
	
	// Die beiden Tree Arrays speichern. 
	/*
		Mit diesen beiden Arrays kann man nun den ganzen 
		pagetree rekonstruieren. In $tree wird die aktuelle 
		page immer als subarray des "parent" gespeichert. 
	
		Bei tree_r wird für jede Seite ein array angelegt.	
	*/
	$tree[$tmp["parent"]][] = $tmp;
	$tree_r[$tmp["site"]] = $tmp;
	if ($tmp["root"] == "Y") $rootpage = $tmp["site"];
}
// Wenn keine Seite als rootpage markiert wurde, aufhören
if ($rootpage == "") die("Sorry, we have no startpage");

<-- SNIPP / SNAPP -->

// Rekursive Funktion zum finden der root Page des aktuellen Astes
function find_root($site) {
	global $tree_r;
	$search = 0; 
	if ($tree_r[$site]["parent"] == "0")
		$search = $site;
	else 
		$search = find_root($tree_r[$site]["parent"]);
	return $search;
}
$search = find_root($site);

if (is_array($tree[$search]))
foreach ($tree[$search] as $page) {
	if ($page["auth"] == "Y") continue;
	$t->set_local(array(
		"page_title" => $page["title"],
		"hash_link" => $_decode[$page["site"]]
		));
	$t_name = "sub_menuitem";
	if (in_array($page["site"], $path)) {
		$t_name = "sub_menuitem_act";
		
	}
	$t->load($t_name, "submenu");
	if (in_array($page["site"], $path)) 
		third_menu($page["site"]);
}
else 
	$t->set_global("submenu", "");

Maybe it's helpfully to you, maybe not...

Cheers,
Florian
Post Reply