Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Pages: 1 [2] 3

Author Topic: [Mini MOD] Keyword Cloud step down  (Read 14646 times)

henrich

  • Sr. Member
  • ****
  • Karma: 23
  • Posts: 381
  • Passion for quality and excellence!
    • My personal blog and portofolio
Re: [Mini MOD] Keyword Cloud step down
« Reply #15 on: August 20, 2008, 07:51:05 pm »

That one which is added to this post? I don't think so :)
Logged
By(e) Henrich :)
------------------------------
IT related blog

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: [Mini MOD] Keyword Cloud step down
« Reply #16 on: August 21, 2008, 07:48:39 am »

manually yes
automatically, no

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Tag Search Redirection to Home Page
« Reply #17 on: September 02, 2008, 07:48:59 am »

Mr Joost?
I got a question Mr Joost and 2 or lines of code  :) in this mini function:
purpose is to redirect the visitor to the default home page automatically when he has clicked on some chosen keywords in a kinda of friendlist with its own array of keywords...
but I don't have any idea how to do it. ???
Can you help me on that? :-*
-----------------------------------
Code: [Select]
<?php

function keyword_array() {
$blacklist = array('contenu','redaction''home-made-porn'); # Added by me
    
$out = array();
    
$query "SELECT keywords_meta FROM " .db('prefix'). "articles WHERE published = 1";
$result mysql_query($query);
while ($r mysql_fetch_array($result)) {
    
$keywords explode(',',$r['keywords_meta']);
    
foreach ($keywords as $value ) {
if (in_array($value,$blacklist)) continue; # Added by me
    
if ( !EntryExist$out$value )) { $out[$value] = 1;
    
} else { $out[$value] += 1; }
}
}
ksort($out);
return $out;
}
?>
EDITION: I wasn't awake when posting. Message was incomprehensible. :-\
« Last Edit: September 02, 2008, 11:51:27 am by Sven »
Logged

Joost

  • Guest
Re: [Mini MOD] Keyword Cloud step down
« Reply #18 on: September 02, 2008, 02:28:43 pm »

Philippe,

Here is the new function keyword_cloud
Edit # NEW array to your likings.
You can edit the new echoed line below # New as well, if needed. Change title tag or change the class to a fixed name.

Code: [Select]
<?php
function keyword_cloud() {
      
$keywords keyword_array();
  $GoHome =array( # NEW array
  '404',
  'Crawltrack',
  'handicaps'
  );
   if (empty(
$keywords)) { echo l('article_not_exist'); } else {
         foreach (
$keywords as $K => $V) {
         
$Key spacestrip($K);
  if(in_array($K$GoHome)){ # New 
  echo '<a class="t'.$V.'" href="',db('website'),'" title = "'.$K.' - '.l('used_in').' '.$V.' '.l('key_article').'" rel="tag">'.$K.'</a> ';
  }  elseif ($V == 1) {
             echo 
'<a class="t'.$V.'" href="tag/'.$Key.'" title = "'.$K.' - '.l('used_in').' '.$V.' '.l('key_article').'" rel="tag">'.$K.'</a> ';
         } else {
         echo 
'<a class="t'.$V.'" href="tag/'.$Key.'" title = "'.$K.' - '.l('used_in').' '.$V.' '.l('key_articles').'" rel="tag">'.$K.'</a> ';
         }
       }
   }
}
?>

Now shower me with karma, be nice to the wife or walk the dog (I still think that cat door is way to small for Paco, don't you?). ;)
Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Tag Search Redirection to the Page when only 1 occurence of a Tag
« Reply #19 on: September 02, 2008, 02:32:35 pm »

Another idea I just had when walking with Paco:
It should be great when there's only 1 occurence of the Tag the visitor is driven directly to the page.
The title attibrute will inform him:
"That Tag is present in only 1 article. You're gonna be to directed to the page.»

EDIT: orthograph corrections.
« Last Edit: September 02, 2008, 02:36:12 pm by Sven »
Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: [Mini MOD] Keyword Cloud step down
« Reply #20 on: September 02, 2008, 02:35:20 pm »

(...)be nice to the wife or walk the dog (I still think that cat door is way to small for Paco, don't you?). ;)
:o
while I was posting this
Quote
Another idea I just had when walking with Paco(...)[/quite]
quite amazing those crossed thoughts!
Now I'm gonna see your code.

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: [Mini MOD] Keyword Cloud step down
« Reply #21 on: September 02, 2008, 03:27:20 pm »

uh oh...
I think I'm still not awaked
EDITION: I wasn't awake when posting. Message was incomprehensible. :-\
What I'm trying to do is much more complicated.
There you gave me a nice piece of code, really, and I karmade you for that.
Are you ready for another one?
The trick is (don't tell Giigle) to have a fake Tag (that's a bit of Black Hat SEO) with its link like:
-http://www.mycheating-site.fr/tag/camembert/ (but if you prefer Gouda, it's your choice)
but when clicked it goes to the homepage.
I'm wondering if I'm not going to be kicked out with tricky thing.
And I'm wondering too if it's possible to have such a code. ???.

Joost

  • Guest
Re: [Mini MOD] Keyword Cloud step down
« Reply #22 on: September 02, 2008, 03:48:56 pm »

It is possible. But you need to be very specific in defining the mechanism you want. Also I am a bit handicapped, because you're install (local) does not seem to find a tag link.
I like any good cheese (except for cheese produced with red/orange fungus). However the European regulations forbid the production of quality food. How can you make a good cheese from pasteurized milk and how can cheese ripe to get its full flavour at these outrageous low temperatures?
These regulations are implemented to benefit multinationals who are not capable of producing quality. Holland had to apply for dispensation for the way meatballs are produced (simmering at a low temperature). Can you believe that?  ???
Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: [Mini MOD] Keyword Cloud step down
« Reply #23 on: September 02, 2008, 04:06:28 pm »

It is possible. But you need to be very specific in defining the mechanism you want. Also I am a bit handicapped, because you're install (local) does not seem to find a tag link.
Well I'ld like to have 2 Tags (camembert and gouda) among my collection of cheese of real Tags in the Tag Cloud.
Normal cheese Tags lead to the Tag search page where the links appears.
I'ld like to have only one page (the Home Page) with gouda and camembert Tags but when camembert or gouda's links such as
-http://my-fromagerie-online/tag/gouda
-http://my-fromagerie-online/tag/camembert
are clicked it goes directly to the Home Page Cremerie.
Is that clearer? :-\
Quote
(..)However the European regulations forbid the production of quality food. How can you make a good cheese from pasteurized milk and how can cheese ripe to get its full flavour at these outrageous low temperatures?
These regulations are implemented to benefit multinationals who are not capable of producing quality. Holland had to apply for dispensation for the way meatballs are produced (simmering at a low temperature). Can you believe that?  ???

No! I really can't. Those pricks in Brussels are walkin on their head!

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: [Mini MOD] Keyword Cloud step down
« Reply #24 on: September 02, 2008, 04:08:49 pm »

Also I am a bit handicapped, because you're install (local) does not seem to find a tag link.
didn't get that at all. ???

Joost

  • Guest
Re: [Mini MOD] Keyword Cloud step down
« Reply #25 on: September 02, 2008, 04:19:48 pm »

didn't get that at all. ???

I mean the package (you've send me some time ago) that is still living on my localhost. I use that to test modifications I make. However, when clicking on a cloudtag, I don't get to see the results that are shown on you're site, instead, I get a 404 error. That makes it slightly more complecated. It is like playing chess with one arm tight behind the back.  (huh?) ???

QUESTION That package, didn't include a .htaccess file.
Are modification needed to get these  tag links working?
« Last Edit: September 02, 2008, 04:28:31 pm by Joost »
Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: [Mini MOD] Keyword Cloud step down
« Reply #26 on: September 02, 2008, 05:03:00 pm »

didn't get that at all. ???

I mean the package (you've send me some time ago) that is still living on my localhost. I use that to test modifications I make. However, when clicking on a cloudtag, I don't get to see the results that are shown on you're site, instead, I get a 404 error. That makes it slightly more complecated. It is like playing chess with one arm tight behind the back.  (huh?) ???

QUESTION That package, didn't include a .htaccess file.
Are modification needed to get these  tag links working?
It does not work on my local neither: I have those URL:
-http://localhost/tag/wai/
or it should be:
-http://localhost/snews/tag/wai/
 ???

Joost

  • Guest
Re: [Mini MOD] Keyword Cloud step down
« Reply #27 on: September 02, 2008, 05:10:27 pm »

Found it  :) :

             echo '<a class="t'.$V.'" href="'.db('website').'tag/'.$Key.'" title = "'.$K.' - '.l('used_in').' '.$V.' '.l('key_article').'" rel="tag">'.$K.'</a> ';
         } else {
         echo '<a class="t'.$V.'" href="'.db('website').'tag/'.$Key.'" title = "'.$K.' - '.l('used_in').' '.$V.' '.l('key_articles').'" rel="tag">'.$K.'</a> ';

Still not working here.  :'(
« Last Edit: September 02, 2008, 05:12:00 pm by Joost »
Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: [Mini MOD] Keyword Cloud step down
« Reply #28 on: September 02, 2008, 05:30:39 pm »

same for me. At first I thought it might come from XAMPP on my WindowsXP server so I've tested with my online .htaccess too, but nope.
It's a complete mystery.

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: [Mini MOD] Keyword Cloud step down
« Reply #29 on: September 02, 2008, 08:31:46 pm »

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.+) $1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule tag/(.+)$ index.php?search=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ index.php?category=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ $1/ [L,R=301]

Is this the problem? Or db('website') not defined (commented)?
« Last Edit: September 02, 2008, 08:34:06 pm by funlw65 »
Logged
Pages: 1 [2] 3