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

Pages: [1] 2 3
1
Hello Vano and other experts

For SEO.

i need like this code ( for header html  and  footer.html )

if ( page is details page (picture page ) ) {my code }
if ( page is category page ) {my code }
if ( page is main page ) {my code }
if ( page is top picters page ) {my code }

and this code must work. but how? $cat_id is ...? ( maybe in home page . or top pages not working . but details page and cat page i need this?
if (in_array($cat_id, $cat_mypics))


Thanx all together

2
hello

i searched this but not found.

i need this modifications.

i have 1 category (but maybe a lot of ) :

and i want to see this catecory. some many other categories subdirectory..


possible  i see

3
Programming / Re: Basic php and mysql question
« on: January 25, 2011, 05:38:34 PM »
Hello vano

i chanced this code in download.php

 if ($user_info['user_level'] != ADMIN) {
    
$sql "UPDATE ".IMAGES_TABLE."
            SET image_downloads = image_downloads + 1
            WHERE image_id = 
$image_id";
    
$site_db->query($sql);
  }


from this

if ($user_info['user_level'] != ADMIN) {

  
//olacak was created . in mysql olacak is integer --> int(11) . and showed this number quality of pic. 
//This number is min photo is quality. some pics olacak's worth 305 , 499, 509, 566, 1000,1455,8787, 9000,..... 
//default 12000
$sql "SELECT olacak  
        FROM "
.IMAGES_TABLE."
       WHERE i.image_active = 1
	
   ORDER BY olacak ASC"
;
$image_row $site_db->query_firstrow($sql);
$olacak_min $image_row['olacak'];  // this must 300 because min olacak worth is = 305

$sql "SELECT image_downloads  
        FROM "
.IMAGES_TABLE."
       WHERE i.image_active = 1
	
   ORDER BY image_downloads DESC"
;
$image_row $site_db->query_firstrow($sql);
$download_max $image_row['image_downloads'];  // this one must 15. because max image_downloads = 15

$downdanekle $olacak_min $download_max;    //  305/15 = 20.333333 (i dont know exatly )

$sql "SELECT olacak
       FROM "
.IMAGES_TABLE."
       WHERE image_id = 
$image_id";
 
$image_row $site_db->query_firstrow($sql);
  
$kacisin $image_row['olacak'];                     // i want to read old   olacAKs worth ( this pic old quality ) maybe 500
  
  
$kacisin $kacisin -  $downdanekle );  // i want to calculate new quality $kacisin = 500 -  20.3333 = 470.666
  
$kacisin = (int)$kacisin;  // i want this $kacisin =470 for to write  mysql olacak  int(11)
  
      
$sql "UPDATE ".IMAGES_TABLE."
            SET image_downloads = image_downloads + 1, olacak = '
$kacisin'
            WHERE image_id = 
$image_id";
    
$site_db->query($sql);
   
  
  
  }



result is unexpected error occured . and not download.

i hope i can explain. 

result is this

An unexpected error occured. Please try again later.

An unexpected error occured. Please try again later.
ÿØÿàJFIFÿş;CREATOR: gd-jpeg v1.0 (using IJG JPE.................................


4
Programming / Basic php and mysql question
« on: January 25, 2011, 02:41:03 PM »
Sorry

i need help

in function.php and in a function. i am using this

$sql "SELECT olacak
        FROM "
.IMAGES_TABLE."
       WHERE image_id = 
$image_id
	
   ORDER BY olacak ASC"
;

$image_row $site_db->query_firstrow($sql);
$olacak_min $image_row['olacak'];

$sql "SELECT image_downloads
        FROM "
.IMAGES_TABLE."
       WHERE image_id = 
$image_id
	
   ORDER BY image_downloads DESC"
;

$image_row $site_db->query_firstrow($sql);
$download_max $image_row['image_downloads'];

$downadd $olacak_min $download_max;


$sql "SELECT  image_downloads, image_hits, alioldu, aliresim, olacak, yuzdepuan
          FROM "
.IMAGES_TABLE."
          WHERE image_id = 
$image_id";
  
$image_row $site_db->query_firstrow($sql);
        
$kacisin $image_row['olacak'];
	
$kacisin $kacisin - ( $image_downloads $downdanekle );
	
$kacisin sprintf("%1\$u"$kacisin); //  <<<<<<  this was problem 
   
..........
	
$yeni_yuzdepuan sprintf("%.2f"$yeni_yuzdepuan);
	
$sql "UPDATE ".IMAGES_TABLE."
            SET alioldu =  olacak = '
$kacisin', yuzdepuan = '$yeni_yuzdepuan'
            WHERE image_id = 
$image_id";
    
$site_db->query($sql);



in my phpmyadmin olacak int(11)  so integer
i try too  $kacisin settype$kacisininteger ); 

 but always 1 came. kacisin is normally.
300.434769

php is bad language, basic command i try to find internet gogle.. but alwayss bla bla bla. too php.net

which command i can use?  $kacisin sprintf("%1\$u"$kacisin); //  <<<<<<  this was problem 
is mistakes
also
$kacisin sprintf("%d"$kacisin); //  <<<<<<  this was problem 

5
Hello Vano and Other Experts

i am still on this problem

and i think problem is.
in function php.

i had wanted to this.

http://www.4homepages.de/forum/index.php?topic=28005.msg151513#msg151513
and i try. and i did.

my php and sql knowledge is very little
so i write this. for top.html and main.html maybe other templates...

function update_image_rating($image_id$rating) {
 


 
$query "SELECT COUNT(*) AS count FROM ".IMAGES_TABLE."
WHERE alioldu > (SELECT alioldu FROM "
.IMAGES_TABLE." WHERE image_id='$image_id')
ORDER BY alioldu DESC" 
;

$q mysql_query($query) or die(mysql_error());
$a mysql_fetch_array($q,MYSQL_ASSOC);
$kac $a['count'];
 
 
$query "SELECT COUNT(*) AS count FROM ".IMAGES_TABLE."
WHERE aliresim > (SELECT aliresim FROM "
.IMAGES_TABLE." WHERE image_id='$image_id')
ORDER BY aliresim DESC"
;

$q mysql_query($query) or die(mysql_error());
$a mysql_fetch_array($q,MYSQL_ASSOC);
$kac2 $a['count'];

$kacisin $kac $kac2;



 global 
$site_db;
  
$sql "SELECT cat_id, image_votes, image_rating, image_hits, alioldu, aliresim, olacak, yuzdepuan
          FROM "
.IMAGES_TABLE."
          WHERE image_id = 
$image_id";
  
$image_row $site_db->query_firstrow($sql);
  if (
check_permission("auth_vote"$image_row['cat_id'])) {
    
$old_votes $image_row['image_votes'];
    
$old_rating $image_row['image_rating'];
	
$old_image_hits $image_row['image_hits'];
    
$new_rating = (($old_rating $old_votes) + $rating) / ($old_votes 1);
    
$yeni_alioldu = (($new_rating) * ($old_votes 1))*10 / ($old_image_hits);
	
$yeni_aliresim = (($new_rating) * ($old_votes 1));
	

.....

	
$sql "UPDATE ".IMAGES_TABLE."
            SET image_votes = (
$old_votes + 1), image_rating = '$new_rating', alioldu = '$yeni_alioldu', aliresim = '$yeni_aliresim', olacak = '$kacisin', yuzdepuan = '$yeni_yuzdepuan'
            WHERE image_id = 
$image_id";
    
$site_db->query($sql);
  }
}

and this code is working, same is in details php.

maybe many sql query is a problem i think. but only one $sql = "UPDATE ".IMAGES_TABLE."

and i haven!t solve this. double votes. and always this message " Sorry, you've already rated for this image once recently   "

6
thnx vano
in details.html

{if user_loggedin}  <center>welcome {user_name} . bla bla bla </center>  {endif user_loggedin}



That is OKey

7
i will try
but

search in your templates / user_loginform.html:

<form action="{url_login}" method="post">

füge darüber ein: paste it:

{lang_loggedin_msg}

in details.html there isn't
<form action="{url_login}" method="post">


and i need only

{username}





8
hello

in detals.html or other html i want to write my registered users. welcome
so

in details.html
{if user_loggedin} <center>welcome {username} . ihope u' are good today. bla bla bla </center> {endif user_loggedin}

what code is {username} ?

TY
edit:
i tryed in details.html

<center> <b>{loggedin_user_namewelcome </b></center>
and unsuccessfull .

9
Mods & Plugins (Requests & Discussions) / {username} in temlate files?
« on: January 24, 2011, 08:19:39 PM »
hello
in pageheader.php
$detailsplsregistermessage "pls register bla bla bla";

....
$site_template->register_vars(array(
...
  
"detailsplsregistermessage" => $detailsplsregistermessage,
....



i am usin in details.html
<center>{detailsplsregistermessage}</center>

but i need  {if userunregisateredorunloged}            

<
center>{detailsplsregistermessage}</center>

{endif 
userunregisateredorunloged}


which basic code is doing this?

TY

Edit : i find

{if user_loggedout
	
<
center>{detailsplsregistermessage}</center> {endif user_loggedout}

10
if i rate again no prolem msg is true : " Sorry, you've already rated for this image once recently   "

problem is first rate. if i rate first. update vote is ok but message is :" Sorry, you've already rated for this image once recently   "

 i had changed in function.php  function update_image_rating($image_id$rating){  ....   }

but message musn't change. i think?
Do you have an idea?

i don't understand in first post , if ihave first rate

 if (!in_array($id$split_list) && !in_array($id$cookie_rated)) { ...

update_image_rating($id$rating);  <-- this code is working
...
else { 
$msg $lang['already_voted'];      <-- this code is working  }

}  


maybe one click and two rate , two details.php  but how?
 


11
hello

in page_header.php there is
 if (!in_array($id$split_list) && !in_array($id$cookie_rated)) {
      
$session_info['rated_imgs'] .= " ".$id;
      
$session_info['rated_imgs'] = trim($session_info['rated_imgs']);
      
$site_sess->set_session_var("rated_imgs"$session_info['rated_imgs']);
      
$cookie_rated[] = $id;
      
$cookie_expire time() + 60 60 24 4;
      
setcookie($cookie_name.'rated'serialize($cookie_rated), $cookie_expireCOOKIE_PATHCOOKIE_DOMAINCOOKIE_SECURE);
      
update_image_rating($id$rating);
      
$msg $lang['voting_success'];
    }
    else {
      
$msg $lang['already_voted'];
    }
  }
  else {
    
$msg $lang['voting_error'];
  }


and i didn't change anything in this code.
but. i have a problem. if i rated  a pic first.. There is " Sorry, you've already rated for this image once recently "  in message but. rating is updating.

if i rate again " Sorry, you've already rated for this image once recently "  in message and rating is not updated.

How? Where is the problem?

12
Mods & Plugins (Requests & Discussions) / Charset Problem in details.html
« on: January 20, 2011, 10:03:00 PM »
hello

i want to use this code

in details html

code <center> {if se_referrer} {se_referreraram&#305;&#351;&#305;n&#305;z... {endif se_referrer}</center>

if se_referrer has turkish chracter this is problem in details.html also   aramışınız..  = aramıÅ�ınız... 

also
if i have a php array in details.html this is a problem.

my 4images tema is turkish. and there is no problem. Categories and pic name , details , links ...


i find internet in php
header("Content-Type: text/html; charset=ISO-8859-9");
and i used in details html but. problem is contiuning

i don't know. this is a charset problem.
or i need have a function ...

Edit

i am using this code now

function cevir($Str) {
$Str str_replace("&#196;&#176;","I",$Str);$Str str_replace("&#196;&#177;","i",$Str);
$Str str_replace("&#195;&#8211;","O",$Str);$Str str_replace("&#195;&#182;","o",$Str);
$Str str_replace("&#195;&#339;","U",$Str);$Str str_replace("&#195;&#188;","u",$Str);
$Str str_replace("&#195;&#8225;","C",$Str);$Str str_replace("&#195;&#167;","c",$Str);
$Str str_replace("&#196;z","G",$Str);$Str str_replace("&#196;&#376;","g",$Str);
$Str str_replace("&#197;z","S",$Str);$Str str_replace("&#197;&#376;","s",$Str);
return 
$Str;
}


13
hello
i have this code

$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.""user_name")."
        FROM ("
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = i.user_id)
        WHERE i.image_active = 1 AND i.cat_id = 
$cat_random AND c.cat_id = i.cat_id
        ORDER BY "
.$selection[$cnt]." DESC, ".$selection_alt[$cnt];


this code is changed from mini top mod
but i have a small problem. some categories has no images. and in this cod $cat_random is random categories.

so there is a problem for me

so i need above in this code like
if ( $cat_random category has no images ) {  ..... }

ty all

14
Hi V@no, and other experts

i have used an mod. and mod has  this code - command

WHERE i.image_active AND c.cat_id i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").")".$selection_cutoff[$cnt]."

i want to exclude some categories


$cat_ext_adsense = array(1,4,6,13,78,98);

how can i change first sql command?


help plss.

ty




15
Mods & Plugins (Releases & Support) / i need small php --> sql help
« on: January 19, 2011, 03:33:45 AM »
hello mans
i need your helps.
in this mod have this code
WHERE i.image_active AND c.cat_id i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").")".$selection_cutoff[$cnt]."


but

i want to exclude some categories numbers.
$cat_ext_adsense = array(84,85,86,87,88,89,95,96);

.......
i  had use this code some files. like this


WHERE i.image_active AND c.cat_id i.cat_id AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN")."," . implode(",", $cat_ext_adsense) .")




i try some many possible  code . but db error  :oops:






Pages: [1] 2 3