|
|
#1 |
|
All Hands On Deck
Join Date: Mar 2008
Posts: 1,052
Rep Power: 28 ![]() |
Help:
Plugin - Category Tag Cloud I think I know the answer to 2. in that main categories are not attributed with the number of adverts in subcategories? but really need help with 1. Is it possible that my database is somehow corrupted or when I first built the site I had these categories which no longer exist? |
|
|
|
|
|
#2 |
|
68 Classifieds Staff
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,020
Rep Power: 116 ![]() |
Try this...
Replace the full plugin code with the following: PHP Code:
__________________
Eric Barnes 68 Classifieds Developer Please do not send me a private message asking for support. Instead use these open forums or our ticket system. Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | 68 @ Twitter | My Modules |
|
|
|
|
|
#3 |
|
All Hands On Deck
Join Date: Mar 2008
Posts: 1,052
Rep Power: 28 ![]() |
Thanks Eric.
I ran myphpadmin and found out that I had some old categories which I never used but these were being picked up by the mysql query. I have deleted them and therefore 1. is no longer a problem. The admin control panel appears not be deleting categories from the database though even though you think you have deleted them. It may be something to look into for a future release. As for number 2, will your module now solve the issue of main categories (where you cannot place adverts in my case) being attributed with the cumulative total of listings in their subcategories. That way, the main categories will get bigger text in the cloud. Thanks |
|
|
|
|
|
#4 |
|
68 Classifieds Staff
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,020
Rep Power: 116 ![]() |
No for #2 you would have to do some type of join or way to add it to the parent. Not very easy I don't think.
__________________
Eric Barnes 68 Classifieds Developer Please do not send me a private message asking for support. Instead use these open forums or our ticket system. Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | 68 @ Twitter | My Modules |
|
|
|
|
|
#5 |
|
All Hands On Deck
Join Date: Mar 2008
Posts: 1,052
Rep Power: 28 ![]() |
Still with the rand() function it works well to include this tag cloud on potentially duplicate pages (e.g. showlistings with < 3 listings) or empty pages coming from searches and categories with nothing in them.
Were you aware the admin panel it may not be deleting categories in the database tables? If I find a solution to combining categories or some weighting system I will post it here. |
|
|
|
|
|
#6 |
|
All Hands On Deck
Join Date: Mar 2008
Posts: 1,052
Rep Power: 28 ![]() |
Here is a nice function to make all pages unique to some degree. The sizes of the entries in the tag cloud are now randomized and so is the order in which they appear. It is also fairly easy to tweek this function further so that the number of entries is randomized as well (I have done that on my actual site). The chances of getting the same combination on any page is remote. To the search engines, duplicate pages start to look a bit different even if they contain similar info within them. The links also have title tags on them as well.
See the affect here by pressing the refresh button or visiting another category or two. French Properties For Sale Here is the function <?php function smarty_function_categories_cloud($params, &$smarty) { global $db; //set a min and max for randomising the font size plus a convenient divisor to scale the font size. $min = '1'; $max = '8'; $divisor = '5'; //set a random number of categories to display - I chhoose a number between 10 and 28 $numberofcats = rand(10,28); $pixel = 'em'; $output = '<div id="tagcloud">'. "\n"; foreach ($params as $_key=>$_value) { switch ($_key) { case 'max': case 'min': case 'pixel': $$_key = $_value; break; } } //now loop the random ordered categories upto your random number of categories and randomise size of the links. $i = 0; $sSQL = "SELECT id,parent_id,name,slug,allowads,cLink FROM ".PREFIX."categories WHERE display<>'N' ORDER BY Rand(), name ASC"; $result=$db->query($sSQL); if($result->size() > 0) { while (($rs=$result->fetch()) && ($i <= $numberofcats)) { $i = $i + 1; $name=safeStripSlashes($rs['name']); $name=htmlspecialchars($name); //add url for category link if($rs['cLink']<>"") { $start_link='<a href="'.$rs['cLink'].'">'; } else { $slug = ( empty($rs['slug']) ) ? $rs['id']: $rs['slug']; $start_link='<a href="category.php?cat='.$slug.'" title="'.$name.'">'; } $size = rand($min,$max)/$divisor; if($size < $min) { $size = $min; } //output $output.='<span style="font-size: '.$size . $pixel.'">'.$start_link . $name .'</a></span>'. "\n"; } $output .= '</div>'. "\n"; return $output; } else { return false; } } ?> Last edited by seymourjames; 07-28-2008 at 02:36 PM. Reason: minr mod required to test on minimum size or firefox makes strange font-size |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Plugin - Category Tag Cloud | Eric Barnes | Modules / Plugins / Modifications | 8 | 01-12-2009 03:14 PM |
| Log In Problems | Kazza | v4 Questions & Support | 17 | 06-03-2008 02:38 PM |
| Image upload problems... | Mikael | v3.1 Questions & Support | 13 | 02-22-2007 08:46 AM |
| Problems with updateOrder function | flyingpylon | v3.1 Questions & Support | 3 | 11-06-2006 08:58 PM |
| If your having problems after an upgrade... From old forum | calaf6 | v3.0 Questions & Support | 0 | 03-30-2006 04:44 PM |