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 - bergblume

Pages: 1 [2] 3 4 5 6 ... 31
16
Since we are on optimizing rage today, little more optimized nic_bck's version:

Code: [Select]
function fixname($text)
{
  return strtolower(strtr(
    $text,
     array(
      "é" => "e",
      "è" => "e",
      "ê" => "e",
      "à" => "a",
      "ë" => "e",
      "â" => "a",
      "ú" => "a",
      "ó" => "o",
      "í" => "i",
      "á" => "a",

      //russian UTF8 encoded alphabet (lower and upper cases)
      "А" => "a",
      "а" => "a",
      "Б" => "b",
      "б" => "b",
      "В" => "v",
      "в" => "v",
      "Г" => "g",
      "г" => "g",
      "Д" => "d",
      "д" => "d",
      "Е" => "e",
      "е" => "e",
      "Ё" => "yo",
      "ё" => "yo",
      "Ж" => "zh",
      "ж" => "zh",
      "З" => "z",
      "з" => "z",
      "И" => "i",
      "и" => "i",
      "Й" => "j",
      "й" => "j",
      "К" => "k",
      "к" => "k",
      "Л" => "l",
      "л" => "l",
      "М" => "m",
      "м" => "m",
      "Н" => "n",
      "н" => "n",
      "О" => "o",
      "о" => "o",
      "П" => "p",
      "п" => "p",
      "Р" => "r",
      "р" => "r",
      "С" => "s",
      "с" => "s",
      "Т" => "t",
      "т" => "t",
      "У" => "u",
      "у" => "u",
      "Ф" => "f",
      "ф" => "f",
      "Х" => "h",
      "х" => "h",
      "Ц" => "c",
      "ц" => "c",
      "Ч" => "ch",
      "ч" => "ch",
      "Ш" => "sh",
      "ш" => "sh",
      "Щ" => "sch",
      "щ" => "sch",
      "Ъ" => "",
      "ъ" => "",
      "Ы" => "i",
      "ы" => "i",
      "Ь" => "'",
      "ь" => "'",
      "Э" => "e",
      "э" => "e",
      "Ю" => "yu",
      "ю" => "yu",
      "Я" => "ya",
      "я" => "ya",
  )));
}
function get_category_url($cat_id,$cat_url = '')
{
  global $site_db, $cat_cache;
  static $urlname = array(); //cache names in this array
  if (isset($urlname[$cat_id]))
    return $urlname[$cat_id];
  if (!empty($cat_cache))
  {
    $row['cat_name'] = @$cat_cache[$cat_id]['cat_name'];
    $row['cat_parent_id'] = @$cat_cache[$cat_id]['cat_parent_id'];
  }
  else
  {
    $sql = "SELECT cat_name,cat_parent_id FROM ".CATEGORIES_TABLE." WHERE cat_id = '".$cat_id."'";
    $row = $site_db->query_firstrow($sql);
  }
  $row['cat_name'] = fixname($row['cat_name']);
  $cat_url  = '-'.str_replace('+','-',urlencode($row['cat_name'])).'-'.$cat_id.$cat_url;
  // if you want full path of category in url, put next line in comment
  $row['cat_parent_id'] = 0;
  if($row['cat_parent_id'] != 0)
  {
    $urlname[$cat_id] = get_category_url($row['cat_parent_id'],$cat_url);
  }
  else
  {
    $urlname[$cat_id] = $cat_url;
  }
  return $urlname[$cat_id];
}
//Mod_bmollet
/**
 * Get the image url
 * @param int $image_id The id of the image
 */
function get_image_url($image_id)
{
  global $site_db;
  static $urlname = array(); //cache names in this array
  if (isset($urlname[$image_id]))
    return $urlname[$image_id];
 
  $sql = "SELECT cat_id,image_name FROM ".IMAGES_TABLE." WHERE image_id = '".$image_id."'";
  $row = $site_db->query_firstrow($sql);
  $row['image_name'] = fixname($row['image_name']);
  // if you want comlpete path to image in url, remove comment from following line
  //$urlname[$image_id] = get_category_url($row['cat_id']).'-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id; 
  $urlname[$image_id] = '-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
  return $urlname[$image_id];
}


Results:

index.php
Original
Code: [Select]
Page generated in 0.109686 seconds with 36 queries, spending 0.059000 seconds doing MySQL queries and 0.050686 doing PHP things. GZIP compression disabledOptimized
Code: [Select]
Page generated in 0.095068 seconds with 11 queries, spending 0.059000 seconds doing MySQL queries and 0.036068 doing PHP things. GZIP compression disabled
categories.php (30 images per page)
Original:
Code: [Select]
Page generated in 0.227558 seconds with 195 queries, spending 0.051000 seconds doing MySQL queries and 0.176558 doing PHP things. GZIP compression disabledOptimized:
Code: [Select]
Page generated in 0.179981 seconds with 37 queries, spending 0.050000 seconds doing MySQL queries and 0.129981 doing PHP things. GZIP compression disabled
details.php
Original
Code: [Select]
Page generated in 0.219341 seconds with 22 queries, spending 0.110000 seconds doing MySQL queries and 0.109341 doing PHP things. GZIP compression disabledOptimized
Code: [Select]
Page generated in 0.060998 seconds with 14 queries, spending 0.028000 seconds doing MySQL queries and 0.032998 doing PHP things. GZIP compression disabled

Many thanks V@no for this great optimization'!!'  :thumbup:

17
ja, ich murks eh schon herum....

naja als "murksen" kann man deine tolle arbeit hier sicherlich nicht bezeichnen  :wink:

18
I replace a key, put a piece of code (step 9) and googlemap.js. as not working and not working

could you solve your problem?

My problem in koordinatencheck.html  of MOD (Google-Maps / GPS Integration V1.2).
As far as I understand, Google has changed the syntax and transfer coordinate marker transfer via jquery is not happening.

Yes, you are right - I could dublicate the problem! perhaps Andi can help (us)?!

19
I replace a key, put a piece of code (step 9) and googlemap.js. as not working and not working

could you solve your problem?

20
Danke dir, Andi!

so wie ich - den bestehenden Code vom  [MOD] Google-Maps Integration V.01 - getestet habe, funktioniert anscheinend auch das automatische "mapping" von der bestehenden googlemaps Api V2  :D
Danke dir auch für deine Ergänzungen bzw. hinweis zum Exif Mod!

21
how can I add this mod? because google maps javascript v3 don't use api key...

Berechtigte Nachfrage!
Gibt es hierzu schon eine Lösung, daß der Mod auch googlemaps v3 kompatibel ist?
Was muss hierzu geändert werden?

22
hi!

it could be that for your adcode the character line is too short...

try VARCHAR( 5000 ) NOT NULL;

instead of VARCHAR( 255 ) NOT NULL;

23
hi kar!
yes that is easily possible.
just build up a custom field for images (e.g. called ads)... this field you can then specifically edit in admin panel as you want.
greetz,
bergblume

24
danke dir, Andi.
mir ging es auch um die Anpassung der Details-Link bei den letzten Kommentaren auf der Startseite (MOD Last Comments)
hierfür musste ich in der index.php diese Zeilen anpassen:

Quote
    "comment_image" => ($view_image) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$row['image_id'])."\" title=\"".$row['image_name']."\">".$thumb."</a>" : $thumb,
    "comment_guest" => ($row['comment_user_id'] == GUEST && !empty($row['guest_user_name'])) ? $lang['userlevel_guest'] : "",
    "comment_image_name" => ($view_image) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$row['image_id'])."\" title=\"".$row['image_name']."\">".stripslashes($row['image_name'])."</a>" : stripslashes($row['image_name']),

(Für diejenigen die es auch machen wollen und die es interessiert)

25
guten morgen andi!
super, vielen vielen dank!
wie muss ich denn noch die functions.php abändern, damit auch die "details-links" entsprechend auch den title-linktext erhalten?
Danke dir,
bergblume

26
hallo zusammen,
wie schaffe ich es, dass alle links in 4images standardmäßig auch innerhalb des a href ein title="Linktext" mit sich führen?
d.h. wenn ich mit dem mauszeiger z.B. über den Link "Kategorie 1" fahre, wird auch "Kategorie 1" angezeigt.
danke euch!

27
gibt es hierzu eigentlich eine "leichte und schnelle" lösung (am besten auf alle Detailseiten einer bestimmten kategorie bezogen)?

28
Discussion & Troubleshooting / Re: IP Adresse komisch
« on: March 12, 2013, 02:14:49 PM »
ja wie gesagt aus dem stegreif kann ich dir jetzt auch nicht sagen woran es liegt..

kein problem - brauchst dir hierzu auch keine weiteren gedanken mehr machen... das tool von nobby reicht für meine zwecke aus!

29
Discussion & Troubleshooting / Re: IP Adresse komisch
« on: March 12, 2013, 01:44:30 PM »
gibs ja nicht, dann müßten die IPs in der session table auch in hex geschrieben sein.
und im ACP müßten die IPs dann ja auch hex dargestellt werden.
Kontrollier das mal

ja, genau - ist auch so!

30
Discussion & Troubleshooting / Re: IP Adresse komisch
« on: March 12, 2013, 10:00:01 AM »
Hallo Andi,

ich habe es mal Eingebaut.

Es wird oben links eine IP-Adresse angezeigt (kein Hex).

nobby

ist bei mir genauso - bloß bei der IP-Adresse bei den kommentaren kommt bei mir HEXA statt "normal"

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