Page 1 of 1

www.ucnopodjetje-irrs.org

Posted: Thu 4. Nov 2004, 20:56
by StudioTandem
My first site with phpwcms: http://www.ucnopodjetje-irrs.org/
I have been looking for decent CMS for a long time and phpwcms seems excellent!

Anyway, I did a little hack - a new replacement tag {NAV_LIST_COLUMN:integer} that acts like {NAV_TABLE_COLUMN:integer} but builds list block (something like <ul><li></li>....</ul>) that you can style with css. Using it in the left column.

Most of the code is based on NAV_TABLE_COLUMN of course...

From content.func.inc.php

Code: Select all

// Left list based navigation 
if( ! ( strpos($content["all"],'{NAV_LIST_COLUMN')===false ) ) {
	$content["all"] = str_replace('{NAV_LIST_COLUMN}', '{NAV_LIST_COLUMN:0}', $content["all"]);
		$replace = 'nav_list_struct($content["struct"],intval($content["cat_id"]),"$1");';
	$content["all"] = preg_replace('/\{NAV_LIST_COLUMN:(\d+)\}/e', $replace, $content["all"]);
}
From front.func.inc.php

Code: Select all


function nav_list_struct ($struct, $act_cat_id, $level) {
	// start with home directory for the listing = top nav structure
	// 1. Build the recursive tree for given actual article category ID
	
	// return the tree starting with given start_id (like breadcrumb)
	// if the $start_id = 0 then this stops because 0 = top level
	
	$level = intval($level);

	// build temp_tree
	$start_id = $act_cat_id;
	while ($start_id) {
		$data[$start_id] = 1;
		$start_id	= $struct[$start_id]["acat_struct"];
	}
	$temp_tree = (sizeof($data)) ? array_reverse($data, 1) : false;

	$temp_menu = build_list_levels ($struct, $level, $temp_tree, $act_cat_id, 0); 
	return $temp_menu;
}

function build_list_levels ($struct, $level, $temp_tree, $act_cat_id, $depth) {
	// this returns the level structure based on given arrays
	// it is special for browsing from root levels

	$temp_menu = "<ul class=\"nav-ul-$depth\">";
	$depth++;
	
	foreach($struct as $key => $value) {
		
		if($_SESSION["frontend_user_in"] && $struct[$key]["acat_regonly"]) $struct[$key]["acat_regonly"] = 0;
		
		if($struct[$key]["acat_struct"] == $level && $key && !$struct[$key]["acat_hidden"] && !$struct[$key]["acat_regonly"]) {
			
			// link ce obstaja redirect
			if(!$struct[$key]["acat_redirect"]) {
				$link = 'index.php?';
				if($struct[$key]["acat_alias"]) {
					$link .= html_specialchars($struct[$key]["acat_alias"]);
				} else {
					$link .= 'id='.$key.',0,0,1,0,0';
				}
				$redirect['target'] = '';
			} else {
				$redirect = get_redirect_link($struct[$key]["acat_redirect"], ' ', '');
				$link = $redirect['link'];
			}
			
			// rekurzivno ... 
			if($temp_tree[$key]) {
				if($act_cat_id == $key) {
					$temp_menu .= "<li class=\"nav-li-active\">";
					$temp_menu .= '<a href="'.$link.'"'.$redirect['target'].'>'.html_specialchars($struct[$key]["acat_name"]).'</a>';
				} else {
					$temp_menu .= "<li>";
					$temp_menu .= '<a href="'.$link.'"'.$redirect['target'].'>'.html_specialchars($struct[$key]["acat_name"]).'</a>';
				}
				
				$temp_menu .= build_list_levels ($struct, $key, $temp_tree, $act_cat_id, $depth);
				$temp_menu .= "</li>\n";
				
			} else {
				$temp_menu .= "<li>";
				$temp_menu .= '<a href="'.$link.'"'.$redirect['target'].'>'.html_specialchars($struct[$key]["acat_name"]).'</a>';
				$temp_menu .= "</li>";
			}
			

		}
	}
	$temp_menu .= "</ul>";
	// KONEC
	return $temp_menu;
}

I know, I should put the code in phpwcms_template/inc_script/frontend_render/ but found that a lit too late :)

Tell me what you think (it's in slovenian so don't expect to understand anything :) )

Posted: Thu 4. Nov 2004, 21:37
by spirelli
Quite nice!
Only that I find it a bit much to get the full animation in the headder on each page. What do you think about having the animation only on the front page?

Posted: Fri 5. Nov 2004, 11:54
by isac
Your website is very nice!

Maybe would be better if flash header animation start a little bit later, because what i see is flash animation playing before content render.

thanks for sharing this {NAV_LIST_COLUMN:integer}

Cumps,
Isac

Posted: Fri 5. Nov 2004, 17:47
by StudioTandem
Yes, I understand that that flash header is a bit too much ...
I will try to do something about it.

Thank you both for nice comments.

Posted: Mon 8. Nov 2004, 08:49
by trip
good looking site :-)
well done...love the way you have made the header...and the background behind it.

It might be a good idea to post your hack under the hacks and enhancements forum...

TriP

slovenian translate

Posted: Tue 23. Aug 2005, 13:35
by smesko
hello

how about uploading slovenian translate into phpwcms ...

--------

a se lahko priporočam za kakšen slovenski prevod?

Re: slovenian translate

Posted: Tue 23. Aug 2005, 15:08
by StudioTandem
I have partially translated phpwcms to slovenian (codepage iso-8859-2) - but it's not full nor finished (and it is for 1.1-RC4).

Please send me your email address and I'll send you translations.

boris
smesko wrote:hello

how about uploading slovenian translate into phpwcms ...

--------

a se lahko priporočam za kakšen slovenski prevod?