Hi!
I see people complaining that custom made templates are difficult to merge with upcoming Pligg versions. Also currently code and look are still not enough separated. I worked out way to smoothly go over onto XSL templating. I spent just one day and made sample work of front page and story page only. I was able to merge completely new unrelated design into Pligg in fast and efficient way. Demo site is http://pligg.jes.ee . Check the source of page!
I still work on it, so expect broken stuff and so on. But you are able to fetch most of code manually following links in source. Sample PHP code:
I propose to drop old smary way and go over to this. Modifications to go over are simple and as benefit users get full control over their layout independently from Pligg development and patches. Also this works faster and makes less load to server.Code:$link=$db->select("*") ->from('digg_links') ->where('link_status="published"') ->orderby('link_date','desc') ->where('link_title_url="'.mysql_real_escape_string($_GET['title']).'"') ->limit(1) ->get(); foreach($link as $item) { $cd = $root-> appendChild($doc->createElement('link')); $title = $cd-> appendChild($doc->createElement('title')); $title->appendChild($doc->createTextNode($item->link_title)); $title = $cd-> appendChild($doc->createElement('votes')); $title->appendChild($doc->createTextNode($item->link_votes)); $title = $cd-> appendChild($doc->createElement('link')); $title->appendChild($doc->createTextNode($item->link_url)); $title = $cd-> appendChild($doc->createElement('summary')); $title->appendChild($doc->createTextNode(strip_tags($item->link_summary))); $title = $cd-> appendChild($doc->createElement('content')); $title->appendChild($doc->createTextNode(strip_tags($item->link_content))); $title = $cd-> appendChild($doc->createElement('comments')); $title->appendChild($doc->createTextNode($item->link_comments)); if(preg_match($pattern,$item->link_summary,$matches)){ $title = $cd-> appendChild($doc->createElement('image')); $title->appendChild($doc->createTextNode(preg_replace($pattern,$img,$matches[0]))); } }
What do you say?



Reply With Quote




