Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ch€ri{Bi}²

Pages: 1 [2] 3 4 5 6 ... 16
16
/search.htm?search_keywords=Харueков
like in output of your MOD.

do you use a mod to show the link? because i did not use search.htm in this mod  :?

17
Is it possible to parse it likewise the details page do? With corerect symbols etc  :?:

try this (i can not test it because i don't have problems with the characters or symbols)
in the original mod, find this code in functions.php:
Code: [Select]
$output .= '<a href="'.$site_sess->url(ROOT_PATH."search.php?search_keywords=".$key.((!empty($mode)) ? "&amp;mode=".$mode : "")).'" style="font-size:'.$size.'%;color:rgb('.mt_rand(64,128).', '.mt_rand(64,128).', '.mt_rand(0,255).');font-family:Arial, sans-serif;" title="'.$value.' '.$lang['tagged_with'].' '.$key.'">'.$key.'</a> ';
and replace it by this one :
Code: [Select]
$output .= '<a href="'.$site_sess->url(ROOT_PATH."search.php?search_keywords=".urlencode($key).((!empty($mode)) ? "&amp;mode=".$mode : "")).'" style="font-size:'.$size.'%;color:rgb('.mt_rand(64,128).', '.mt_rand(64,128).', '.mt_rand(0,255).');font-family:Arial, sans-serif;" title="'.$value.' '.$lang['tagged_with'].' '.format_text($key, 2).'">'.format_text($key, 2).'</a> ';
 :arrow: Tell me if it works !

18
hi,

this is a little modification : it shows a cloud of your categories (random categories by hits).

in the original mod , in STEP2, replace the code in functions.php by this one :

Code: [Select]
//---[ [MOD] Tag Cloud]
function get_tag_clouds() {

  global $site_db, $site_sess, $lang;
 
  $output = "";
 
  $max_to_show = 10 // max items to display
 
  $max_size = 300; // max font size in %
  $min_size = 70; // min font size in %
 
  $max_qty = 0;
  $min_qty = 0;
 
  $sql = "SELECT cat_id, cat_name, cat_hits
          FROM ".CATEGORIES_TABLE."
          ORDER BY RAND()";
  $result = $site_db->query($sql);
 
  while ($row = $site_db->fetch_array($result)) {
    $tags_hits[$row['cat_id']] = $row['cat_hits'];
$tags[$row['cat_id']] = $row['cat_name'];
  }
 
  $max_qty = max(array_values($tags_hits));
  $min_qty = min(array_values($tags_hits));
 
  // find the range of values
  $spread = $max_qty - $min_qty;
  if ($spread == 0) { // we don't want to divide by zero
  $spread = 1;
  }
       
  // set the font-size increment
  $step = ($max_size - $min_size) / ($spread);
  $i = 0;
  foreach ($tags as $key => $value) {
  if ((check_permission("auth_viewcat", $key)) && $i < $max_to_show)  {
                // calculate font-size
                // find the $value in excess of $min_qty
                // multiply by the font-size increment ($size)
                // and add the $min_size set above
                $size = round($min_size + (($tags_hits[$key] - $min_qty) * $step));
        $css_color =  'rgb('.mt_rand(64,128).', '.mt_rand(64,128).', '.mt_rand(0,255).')';
                $output .= '&nbsp;<a href="'.$site_sess->url(ROOT_PATH."categories.php?cat_id=".$key).'" style="font-size:'.$size.'%;color:'.$css_color.';font-family:Arial, sans-serif;" title="'.$lang['category'].' '.$value.' / Hits: '.$tags_hits[$key].' ">'.$value.'</a>&nbsp;';

$i++;
}
  }

  return $output;
}
//---[/[MOD] Tag Cloud]

that's all folks !  :wink:

 :idea: and now... for all those who asked (or will ask) how to show this  and how to show that :

take the sql part of the code:
Quote

$sql = "SELECT cat_id, cat_name, cat_hits
          FROM ".CATEGORIES_TABLE."
          ORDER BY RAND()";
  $result = $site_db->query($sql);
 
  while ($row = $site_db->fetch_array($result)) {
    $tags_hits[$row['cat_id']] = $row['cat_hits'];
   $tags[$row['cat_id']] = $row['cat_name'];
  }


and change the part in red to display the id/name/hits you want  and don't forget to change the link   :wink:

19
place the code in functions.php
and after this, you can apply it on any text (let's say $some_text is your text with special characters)  by using :
Code: [Select]
$some_text = clean_text($some_text);

20
for all the errors, check this part of the code in functions.php after the first sql query:
Code: [Select]
while ($row = $site_db->fetch_array($result)) {
    $tags[$row['word_text']] = $row['quantity'];
  }

 :?:  can you say it returns an array? 

afer the last code, insert this (for debug):
Quote
print_r($tags);
it will show you if $tags is an array or not...

 :arrow: because all the code is based on the query result... so if there is no result or if the query fails... it will show noting...

21
But turkish
Code: [Select]
ü, Ü, ö, Ö, i, İ letter,
wrong display: ue
example: ueniversitesi  to üniversitesi
example: koy to köy
hi
your problem is not related to this mod...
but try his code to replace accentuated or special characters in some text :
Code: [Select]
function clean_text($text)
    {
     $clean_text= strtr($text,
   "ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ",
   "aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn");

     return $clean_text;
    }
you can add some new character...

24
hi all,

this is a version of the tag clouds  8) for 4images...
this little mod display a cloud of keyword (see here for categories), sort by quantity (the more the keyword is used in the gallery, bigger will be the font).
 :!: only real keywords : i mean no keywords from name or description
you can see a demo on my site.

first : backup your files and

STEP1 : open includes/page_header.php
and add at the very end before ?>:
Code: [Select]
$site_template->register_vars(array(
  "lang_keyword" => $lang['keywords'], //---[/[MOD] Tag Clouds]
  "show_tag_clouds" => get_tag_clouds() //---[/[MOD] Tag Clouds]
));

STEP2 : open includes/functions.php
and add at the very end before ?>:
Code: [Select]
//---[ [MOD] Tag Cloud]
function get_tag_clouds() {
global $site_db, $lang, $site_sess, $mode;
$output = "";
   
  $sql = "SELECT i.word_id, i.word_text, COUNT(c.word_id) AS quantity
  FROM ".WORDLIST_TABLE." i
LEFT JOIN ".WORDMATCH_TABLE." c ON i.word_id = c.word_id
WHERE keys_match > 0
  GROUP BY i.word_text
  ORDER BY  RAND()
LIMIT 20";

  $result = $site_db->query($sql);
  while ($row = $site_db->fetch_array($result)) {
    $tags[$row['word_text']] = $row['quantity'];
  }
 
  //uncommentnext line to sort the tag array in reverse order (+ => -)
   //arsort($tags);   
        $max_size = 250; // max font size in %
        $min_size = 50; // min font size in %
       
        // largest and smallest array values
        $max_qty = max(array_values($tags));
        $min_qty = min(array_values($tags));
       
        // find the range of values
        $spread = $max_qty - $min_qty;
        if ($spread == 0) { // we don't want to divide by zero
                $spread = 1;
        }
       
        // set the font-size increment
        $step = ($max_size - $min_size) / ($spread);
       
        // loop through the tag array
        foreach ($tags as $key => $value) {
                // calculate font-size
                // find the $value in excess of $min_qty
                // multiply by the font-size increment ($size)
                // and add the $min_size set above
                $size = round($min_size + (($value - $min_qty) * $step));
       
                $output .= '<a href="'.$site_sess->url(ROOT_PATH."search.php?search_keywords=".$key.((!empty($mode)) ? "&amp;mode=".$mode : "")).'" style="font-size:'.$size.'%;color:rgb('.mt_rand(0, 255).', '.mt_rand(0, 255).', '.mt_rand(0, 255).');font-family:Verdana, Arial, Helvetica, sans-serif;" title="'.$value.' '.$lang['tagged_with'].' '.$key.'">'.$key.'</a> ';
        }

 
  return $output;
}
//---[/[MOD] Tag Cloud]
read the comments and change some setting and styles to fit your needs  :wink:

last step , open main.php in your language dir and add at the end:
Code: [Select]
$lang['tagged_with'] = "image(s) with tag: ";

now add the 2 tags {lang_keyword} and {show_tag_clouds}  anywhere in you template.

PS: for all the users who love statistics, the cloud tag can take other parameters than mine... just found the query and change it in function.php
 :idea:  :arrow: see here to find how to do this tag cloud with categories

25
Discussion & Troubleshooting / Re: Permissions for users and Usergroups
« on: January 18, 2007, 09:11:19 PM »
well, the permissions are kind of confusing...there are two types of permissions, for groups and for members. What you see there are permissions for that individual member and not global permissions from different groups the member is in...
:? confusing... that's the word...  :?
 if i have a user in a group, when i use this code :
Quote
check_permission("auth_xxxxx", $cat_id)
what permission did i get?
 :?: user permissions or group permissions?

26
Mods & Plugins (Releases & Support) / Re: [MOD] Download limit v1
« on: January 11, 2007, 08:42:39 AM »
Fatal error: Call to undefined function: update_dl_limit() in /home/xxx/domains/xxx/public_html/xxx/download.php on line 373
this means your script did not find the mentioned function... :?
are you sure to have this function ( :arrow: function update_dl_limit($dl) ) in your download.php file (or in your functions.php file) in the right place?

27
P.S. this list could also be shown on the user profile page ...
Yep, there is an existing mod to show all the pictures (as a link) coming from a user.... in user profile ... and i have it installed ...

28
my style css :

.bordercolor {
}
.head2{}
.tablehead{}
.imagerow1{}
.imagerow2 {}
.navbar {}
.button_new {}
.class_table {}
these classes should not be empty  :?

1 - open the default 4images stylesheet  (style.css in templates/default dir)
2 - take the original values of classes   
3 - put them in your own stylesheet

29
in mine css has all the necessary values =/
and these values are ....????

just modify the red parameter in your /includes/page_header.php:
Quote
$nav_calendar = get_calendar('', bordercolor, head2, tablehead, imagerow1, imagerow2, navbar, button_new);
// paramters => function get_calendar($date = '', $class_table, $class_nav, $class_week_days, $class_noday, $class_eachday, $class_today,$class_linkday)

as i said in the original post:
Quote from: cheribibi
Note : these values ( bordercolor, head2, tablehead, imagerow1, imagerow2, navbar, button_new ) are mine. it correspond to the classes (see in the file style.css into your template directory) who will be used for the calendar.
Do not hesitate to modify them to personalize the colors of your calendar.

you must take some  values of classes from your own css stylesheet and replace them in the code...

30
i think your problem is related to this
these values depend on your css stylesheet.

Pages: 1 [2] 3 4 5 6 ... 16