http://www.mauss-automobile.de

post released sites here made with phpwcms
Post Reply
kubens
Posts: 168
Joined: Sat 6. Nov 2004, 15:29
Location: Duesseldorf near Cologne ;-)

http://www.mauss-automobile.de

Post by kubens »

After some month of hard work I finished a project which is realized in parts with phpWCMS. Some of us knows that my favourite branche is normally the tourism branche, but this time the project have nothing to do with tourism. This time the customer is a local car dealer.

This time the project based on two parts. Part one is a complete backoffice solution. The backoffice was realized with Symfony. Part two is the website itself which runs with phpWCMS. The complete search module was realized with Ajax and is a part of the backoffice, which is embedded into the layout.

Unfortunatelly a lot of my ideas were disliked. Anyway this project should be listed here too, because I am very interested into your feedback. So it would be great if you spent some minutes into this project. Any feedback would be appreciated :-)

http://www.mauss-automobile.de

Br
Wolfgang
macmukka

Post by macmukka »

like it - very nice -

see you have friendly URLs again!

Is this running 1.3.x or did you stick with 1.2.6?

All the best -
User avatar
StudioZ
Posts: 802
Joined: Fri 28. May 2004, 19:57
Location: Québec, Canada
Contact:

Post by StudioZ »

Hey kubens! :D
Very impressive !!! :D :D :D
At first I tought you had ExData powering this great listing :roll:
Anyhow... very good job! I like this Symfony usage!
If only I could find some spare time to look into this Symfony deeper...
Thanks for sharing 8)

Cheers,

Yves
Image
PhpWCMS Evangelist, -- iRoutier.com Running phpWCMS 1.4.2, r354 -> Great Version!!!!
kubens
Posts: 168
Joined: Sat 6. Nov 2004, 15:29
Location: Duesseldorf near Cologne ;-)

Post by kubens »

@macmukka
Yes, you know I like these friendly URLs, but unfortunatelly this part was realized with the good old, but pimped 1.2.6. I am still waiting like all the others here for the next release...

@StudioZ
This was my first project with Symfony and I made of lot beginners mistakes, but in the meantime I learned a lot and you should definitely spent time in this amazing and powerfull framework. Great community, great documentation, great plugins in few words a lot of possibilities, but also a lot of things which must learned before.

The car dealer backoffice application is very flexible unfortunatelly the customer does not use the real and complete potential of the backoffice. I learned a lot of this business durring the project and 'inshala' I will use these skills to build up a new release later which could used for an ASP car dealer solution. But at this moment I am overworking the whole backoffice / frontend parts of my private tourist sites and you can assume which technologies will be used in next releases ;-)

Br
Wolfgang
Olli_another_one
Posts: 48
Joined: Sun 25. Mar 2007, 01:03
Contact:

Post by Olli_another_one »

sorry but iam to lazy to write it in english (short i like the design) ;)

mir gefaellt diese hintergrundbilder welche dieses linienmuster erzeugen.
auch farblich ist alles gut angepasst. sieht wirklich huebsch aus :)
kubens
Posts: 168
Joined: Sat 6. Nov 2004, 15:29
Location: Duesseldorf near Cologne ;-)

Post by kubens »

@macmukka

It is time to start playing with 1.3.5 (trunk 2007-09-19). I did and I dived into the source. Especially regarding the article alias issue which is not finished in this release. As far as I pointed out the approach of Oliver for this feature seems to be that the link for the article link will generate depending of the article category:

Code: Select all

Site Structure + Aricle:

-Category1 (alias: c1)
-Category2 (alias: c2)
  -Category21 (alias: c21)
    -Article1_C21 (alias: a1c21)
    -Article2_C21 (alias: a2c21)
  -Category22 (alias: c22)
-Category3 (alias: c3)
-Category4 (alias: c4)
If I am correct in my assumption then the complete link respective alias for the articles will be:

Code: Select all

Article1_C21 = /c2/c21/a1c21
Article2_C21 = /c2/c21/a2c21
My approach is to generate an article link which is decopled from the article category:

Code: Select all

Site Structure + Aricle:

-Category1 (alias: /c1/)
-Category2 (alias: /c2/)
  -Category21 (alias: /c2/c21/)
    -Article1_C21 (alias: /c2/c21/a1c21/)
    -Article2_C21 (alias: /c2/c21/a2c21/)
  -Category22 (alias: /c2/c22/)
-Category3 (alias: /c3/)
-Category4 (alias: /c4/)
Therefore I made first some modifications which enables to key in '/' in corresponding alias fields on article and structure level:

Code: Select all

****************************************************
* File: include/inc_js/phpwcms.js
* 
* org: str = str.replace(/[^a-z0-9_\-]/g,'');
* wak: str = str.replace(/[^a-z0-9_\-/]/g,'');
*
****************************************************
function create_alias(str,encoding,ucfirst)
{
	str = str.toUpperCase();
	str = str.toLowerCase();
	
	str = str.replace(/[\u00E0\u00E1\u00E2\u00E3\u00E5]/g,'a');
	str = str.replace(/[\u00E7]/g,'c');
	str = str.replace(/[\u00E8\u00E9\u00EA\u00EB]/g,'e');
	str = str.replace(/[\u00EC\u00ED\u00EE\u00EF]/g,'i');
	str = str.replace(/[\u00F2\u00F3\u00F4\u00F5\u00F8]/g,'o');
	str = str.replace(/[\u00F9\u00FA\u00FB]/g,'u');
	str = str.replace(/[\u00FD\u00FF]/g,'y');
	str = str.replace(/[\u00F1]/g,'n');
	str = str.replace(/[\u0153\u00F6]/g,'oe');
	str = str.replace(/[\u00E6\u00E4]/g,'ae');
	str = str.replace(/[\u00DF]/g,'ss');
	
	// additional German "Umlaute"
	str = str.replace(/[\u00FC]/g,'ue');

	str = str.replace(/[ ]/g,'-');
  str = str.replace(/[^a-z0-9_\-/]/g,'');
	str = Trim(str);

	if (ucfirst == 1) {
		c = str.charAt(0);
		str = c.toUpperCase()+str.slice(1);
	}

	return str;
}

****************************************************
* File: include/inc_act/act_structure.php
* 
* org: $alias = get_alnum_dashes($alias, true);
* wak: removed
* 
****************************************************
function proof_alias($acat_id, $alias) {

	$alias = clean_slweg($alias, 150);
	if(empty($alias)) $alias = clean_slweg($_POST["acat_name"], 150);
	
	if($alias == 'index' && $acat_id != 'index') {
		$alias = 'index'.date('jny');
	} elseif($alias == 'aid') {
		$alias = 'aid'.date('jny');
	} elseif($alias == 'id') {
		$alias = 'id'.date('jny');
	}
	
	$sql  = "SELECT COUNT(acat_id) FROM ".DB_PREPEND."phpwcms_articlecat WHERE acat_id != ".intval($acat_id);
	$sql .= " AND acat_alias='".aporeplace($alias)."'";

	if( _dbQuery($sql, 'COUNT') ) {

		$sql  = "SELECT count(*) FROM ".DB_PREPEND."phpwcms_articlecat WHERE acat_id != ".intval($acat_id);
		$sql .= " AND acat_alias LIKE '".aporeplace($alias)."%'";
		
		if($count_alias = _dbQuery($sql, 'COUNT')) {
			$alias .= '-' . $count_alias;
		}
	}
	
	return $alias;
}
To enable phpWCMS to find the correct article based on article alias I enhanced the index.php:

Code: Select all

****************************************************
* File: index.php
****************************************************
...
// some initial actions
cleanupPOSTandGET();
define('FE_CURRENT_URL', PHPWCMS_URL . 'index.php' . buildGlobalGET('getQuery'));

/**
 * @titel:            wakGetArticleIdByArticleAlias
 * @description:      extracts article id based on an article alias
 * @author:           Wolfgang Kubens
 * @last modified:    2007.09.29 updated for 1.3.5
 *                    2006.01.17 created for 1.2.6                                                 
 * @parameters:       String $alias 
 * @returns:          String $id
 */
function wakGetArticleIdByArticleAlias($alias) {
  $id = null;
	$sql  =	'SELECT article_id FROM '.DB_PREPEND.'phpwcms_article WHERE article_alias = "'.$alias.'" AND article_deleted=0 AND article_public = 1 AND article_aktiv=1 LIMIT 1';

  if($result = mysql_query($sql)) {
  	if($row = mysql_fetch_row($result)) {
      $id = $row[0];
    }
    mysql_free_result($result);
  }

  return $id;
}
  
// if set by buildGlobalGET 
// then quit 
if (!isset($GLOBALS['_getVar']) || !isset($GLOBALS['_getVar']['aid'])) {
  $_GET['aid'] = wakGetArticleIdByArticleAlias($_SERVER['QUERY_STRING']);
}

//script caching to allow header redirect
//if($phpwcms["compress_page"] && isset($_SESSION['session_is_set'])) {
//	ob_start("ob_gzhandler"); //with old style GZ Compression
//} else {
//	$_SESSION['session_is_set'] = true;
ob_start(); //without Compression (or use browsers default)
//}
...

Finally for those who needs find below apache rewrite rule for this:

Code: Select all

RewriteEngine on
RewriteLogLevel 3
RewriteLog logs/phpwcms.ROOT.1.3.5.rewrite.log
RewriteRule ^(.*)/$ /index.php?$1/ [L]

Normally I do not prefere to enhance core files, but may this is interesting for some of us who are waiting for next release with the same patience as I do ;-)

Br
Wolfgang
kubens
Posts: 168
Joined: Sat 6. Nov 2004, 15:29
Location: Duesseldorf near Cologne ;-)

Post by kubens »

@macmukka

If you wants to replace the orginal generated links by your user friendly aliases then you can use the following code. It is realized as a replacement tag.

Code: Select all

<?php
****************************************************
* File: template/inc_script/frontend_render/99.wak.rt.links.php
****************************************************

/**
 * @titel:          wakGetArticleAliasByIds
 * @description:    extracts article alias based on passed id
 * @params          Array    ids
 * @return          Hash     aliases[<article_id>]=<article_alias>
 * @author:         W.A.Kubens
 * @version:        0.1
 * @last_modified:  2007.09.30 created
 */
function wakGetArticleAliasByIds($ids) 
{
  $aliases = array(); 

  // return if no ids were passed
  if ($ids === '') 
  {
    return $aliases; 
  }

  // extract all articles based on passed id 
  $ids = is_array($ids) ? implode(',', $ids) : $ids;
  $sql = 'SELECT article_id, article_alias FROM '.DB_PREPEND.'phpwcms_article WHERE article_id IN('.$ids.') AND article_deleted=0 AND article_public = 1 AND article_aktiv=1';
  if($result = mysql_query($sql)) 
  {
    while ($row = mysql_fetch_row($result)) 
    {
      $aliases[$row[0]]=$row[1];
    }
    
    mysql_free_result($result);
  }

  return $aliases;
}

/**
 * @titel:          wakRT_WAKLINKS_ARTICLE
 * @description:    *
 * @params          Hash     aliases[<article_id>]=<article_alias>
 *                  Number   article id
 * @return          String   link
 * @author:         W.A.Kubens
 * @version:        0.1
 * @last_modified:  2007.09.30 created
 */
function wakRT_WAKLINKS_ARTICLE ($articleAliases, $id) 
{
  $link = $articleAliases[$id];
  return $link.'">'; 
}

/**
 * @titel:          wakRT_WAKLINKS_STRUCTURE
 * @description:    *
 * @params          String   alias
 * @return          String   link
 * @author:         W.A.Kubens
 * @version:        0.1
 * @last_modified:  2007.09.30 created
 */
function wakRT_WAKLINKS_STRUCTURE ($alias) 
{
  return 'href="'.$alias.'">'; 
}


// extract all article ids from content
$articleIds = array();
preg_match_all("/index\.php\?aid=(.*)\">/", $content['all'], $articleIds);

// extract all article aliases based on extracted article ids
$articleAliases = wakGetArticleAliasByIds($articleIds[1]);

// replace article aliases
$content['all'] = preg_replace('/index\.php\?aid=(.*)\">/e','wakRT_WAKLINKS_ARTICLE($articleAliases, "$1");',$content['all']);

// replace structure aliases
$content['all'] = preg_replace('/href=(.*)index\.php\?(.*)>/e','wakRT_WAKLINKS_STRUCTURE("$2");',$content['all']);

?> 
Just to ensure that this replacement tag runs as last from the list of existing custom replacement tags (look for the filename) and you will get user friendly links. I checked this logic not with all existing replacement tags, but as far as I could see this works very smooth and without problems.

Of course any feedback would be appreciated, but do not try to ask me for support. This is just a personal interims solution as long as I must wait for the next release. Patience is not my profession, at least sometimes ;-)

Br
Wolfgang
macmukka

Post by macmukka »

ok - time to sit down and concentrate!

thanks Kubens for your help, I'm going to take some time with this.

Best -
dorothai
Posts: 6
Joined: Thu 17. May 2007, 10:51

Hallo Kubens,

Post by dorothai »

Ich sehe bei vielen den gleichen Fehler: auf Suchmaschinen wird kaum geachtet. Wenn hier ein Bot langs kommt hat er nichts zum indexen - es sind alles Images und kaum oder garkein Text der Relevanz mit der Website Kategorie hat - da helfen auch nice URLS nix.
Versuche mehr mit background images zu arbeiten und versuche soviel wie moeglich Text Links zu coden die die Pages miteinander verknuepfen.
Weder VW noch Audi noch Autovertrieb oder sonstige relevanten search terms werden diese Website jemals finden.
Das ist als ob die Site nicht besteht - es sei du investierst unheimlich viel Geld in Online Marketing.

Trotzdem wuensch ich dir viel Erfolg und ja, man lernt jeden Tag etwas dazu, das Web geht entwickelt sich immer mehr zu einem kompetitiven Feld mit Google als Koenig.

Gruss Doris
User avatar
kukki
Posts: 1707
Joined: Mon 7. Feb 2005, 20:02
Location: Berlin Köpenick
Contact:

Post by kukki »

Ich kann mich da nur anschließen. :? Dass man mit diesem wCMS einen guten Platz bei Google und Konsorten erreichen kann haben einige bewiesen, schade, dass auch diese/ Deine Entwicklung da keinen Wert drauf legt.

Beim Studium des Quellcode habe ich mich gefragt, warum denn da ein phpWCMS benutzt wurde. Mittel zum Zweck oder wurden aus einem anderem Grund keine Alternativen in Erwägung gezogen :?:
Lieber arm dran als Arm ab!

meine historische Website: Jagdgeschwader 300 1.9.34-R554
kukki's SpIeLwIeSe V.1.9.33 R553 responsive
kubens
Posts: 168
Joined: Sat 6. Nov 2004, 15:29
Location: Duesseldorf near Cologne ;-)

Post by kubens »

Thanks to all.

I fully aggree to all. The best website make no sense if there is no real content. That is something which needs not to be discussed again and especially not between us. I think that we have all the same meaning about this.

I discussed this issue and some others very clear with the customer and I explained and showed him good examples. To provide the customer the best possible tool I decided to use phpWCMS.

Everybody knows how easy it is to fill now hundred or thousand of pages with content. But everybody knows too, that it is often impossible to convenience a customer who has a lot of experiences for many years and who is successfull, what he must do, which effort is necessary to be successfully in internet too. I discussed with the customer about wording, about the message which he wants to make transparent on his page. Durring this discussions the customer aggreed, but his texts does not reflex this.

However, maybe the customer will change his mind and maybe that the customer will change his strategy, then the customer can realize this with existing tools. No additional time effort for training or developement, no additional money everything is there. phpWCMS ;-)

The hack above was not made for this customer. As mentioned above I used for the customer a pimped 1.2.6 and it was made for other projects, which contains a lot of content and which is findable in Google too. The hack above was made, because I want to start with 1.3.5 as soon as possible and this feature is still not finished. Unfortunatelly patience is not my profession ;-)

Br
Wolfgang
macmukka

Post by macmukka »

Thanks Kubens - I've been trying some things...

I see that your ideas have been incorporated in to 1.35 Oct 09 07 release.

After I added your index.php it worked...

but how about doing this for phpwcms.js:-

Code: Select all

function set_article_alias(onempty_only, alias_type) {
	if(alias_type == 'struct') {
		var alias_basis		= 'acat_name';
		var alias_target	= 'acat_alias';
	} else {
		var alias_basis		= 'article_title';
		var alias_target	= 'article_alias';
		var alias_cat		= 'article_cid';
	}
	
	var aalias = getObjectById(alias_target);
	if(onempty_only && aalias.value != '') return false;
	var atitle = getObjectById(alias_basis);
	var acat = getObjectById(alias_cat);
	var cat = acat[acat.value].innerHTML;
	aalias.value = create_alias(cat) + '\/' + create_alias(atitle.value);
	//console.log(acat[acat.value].innerHTML);
	return false;
}
then url becomes

http://www.site.com/struct/article

- thanks again!
Post Reply