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

Pages: 1 [2] 3
16
You are right V@no, I have made it different, maybe later someone can improve it.

Here we go:

STEP #1:
Create a new custom page
http://www.4homepages.de/forum/index.php?topic=4996.0


STEP #2:
On this new page, on content part, add (You must modify "yourdatabasehost","youruser","yourpassword" for your data):

Code: [Select]
//Optional styles
<style type="text/css">
<!--
.top {
width:auto;
padding:10px;
float:left;
margin-right:40px;;
}
.top h2{
line-height:150%;
font-size:16px;
}
-->
</style>                     
                      <?php
                       
function Connect()
                      {
                           if (!(
$link=mysql_connect("yourdatabasehost","youruser","yourpassword")))
                          {
                                  echo 
"Error connecting to database";
                                  exit();
                           }
                           if (!
mysql_select_db("yourdatabasename",$link))
                          {
                                  echo 
"Error selecting database.";
                                  exit();
                           }
                           return 
$link;
                        }
                                          
$link=Connect();
?>



<div class="top"></div>
<div class="top">
<h2>Top 15 - Votes </h2>
<p>
<?php 
  
$sql "SELECT 4images_categories.cat_id AS CAT_ID, sum( `image_votes` ) AS VOTES, 4images_categories.cat_name AS NAME
FROM `4images_images` , `4images_categories`
WHERE 4images_images.cat_id = 4images_categories.cat_id
AND cat_parent_id =125  
GROUP BY 4images_images.cat_id
HAVING sum( `image_votes` ) >100 
ORDER BY VOTES DESC
LIMIT 0 , 15 "
;

 
//* AND cat_parent_id =125               --> This line is exclusive for selected subcategories, in this case, all subcategories of category 125
//*  HAVING sum( `image_votes` ) > 100    --> Minimal votes quantity
//*  LIMIT 0 , 15 ";                      --> In this case it will display a top 15 list, change this number for your preferred.

$result mysql_query($sql,$link);
$i=0;
  
while ($row mysql_fetch_array($resultMYSQL_ASSOC)) {
     
  $i++;
echo "<a href=categories.php?cat_id={$row['CAT_ID']}>#".$i."</a> {$row['VOTES']} "." <a href=categories.php?cat_id={$row['CAT_ID']}>{$row['NAME']}</a><br>";  
}
?>

</p>
</div>
<div class="top">
<h2>Top 15 - Visits </h2>
<p>
<?php 
  
$sql "SELECT 4images_categories.cat_id AS CAT_ID, sum( `image_hits` ) AS HITS, 4images_categories.cat_name AS NAME
FROM `4images_images` , `4images_categories`
WHERE 4images_images.cat_id = 4images_categories.cat_id
AND cat_parent_id =125
GROUP BY 4images_images.cat_id
HAVING sum( `image_votes` ) >100
ORDER BY HITS DESC
LIMIT 0 , 15 "


$result mysql_query($sql,$link);
$i=0;
  
while ($row mysql_fetch_array($resultMYSQL_ASSOC)) {
     
  $i++;
echo "<a href=categories.php?cat_id={$row['CAT_ID']}>#".$i."</a> {$row['VOTES']} "." <a href=categories.php?cat_id={$row['CAT_ID']}>{$row['NAME']}</a><br>";   
}
?>

</p>
</div>
<div class="top" style="margin:0px;">
<h2>Top 15 - Rating </h2>
<p>
<?php 
  
$sql "SELECT 4images_categories.cat_id AS CAT_ID, avg( `image_RATING` ) AS VOTOS, 4images_categories.cat_name AS NAME
FROM `4images_images` , `4images_categories`
WHERE 4images_images.cat_id = 4images_categories.cat_id
AND cat_parent_id =125
GROUP BY 4images_images.cat_id
HAVING sum( `image_votes` ) >100
ORDER BY VOTOS DESC
LIMIT 0 , 15 "


$result mysql_query($sql,$link);
$i=0;
  
while ($row mysql_fetch_array($resultMYSQL_ASSOC)) {
     
  $i++;
echo "<a href=categories.php?cat_id={$row['CAT_ID']}>#".$i."</a> {$row['VOTES']} "." <a href=categories.php?cat_id={$row['CAT_ID']}>{$row['NAME']}</a><br>";    
}
                        
mysql_close($link);
?>

</p>
</div>

You can see the final result here Hi5 Girls Contest
That's it, let me know if you have some problems.

17
In order to this request: http://www.4homepages.de/forum/index.php?topic=5789.0 I have started this mod, but, this is my first attempt, i need some help, can someone help me:

The first Step would be:

Add in includes/functions.php

this code:

Code: [Select]
// Top Categories
function get_top_categories() {
  global $site_db, $cat_cache, $total_images;
  $categories_top = array();
  $cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");

  $sql = "SELECT c.cat_name AS NAME, sum( `i.image_votes` ) AS VOTES
  FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
            WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_id
            GROUP BY cat_id
HAVING sum( `i.image_votes` ) > 100 //MINIMAL VOTES FOR THE TOP LIST
ORDER BY VOTES DESC
LIMIT 0 , 15";  // IN THIS CASE FOR MY TOP 15 LIST
   
  $result = $site_db->query($sql);
  while ($row = $site_db->fetch_array($result)) {
     // $categories_top[$row['cat_id']] = $row;
echo $row['NAME']. " - ". $row['VOTES'];
echo "<br />";
  }
  return $categories_top;


Second Step:
(I'm lost here, i don't know how to call a function from other page, for example, how to associate let's say {top_categories} to this function)

Someone knows how?

Thanks
Sorry if i posted this topic in the wrong section, i hope this be finished soon like a real MOD

18
I'm working on it, i have the sql queries for top categories by rating, by votes and by hits, i'm finishing the php part.

I'll be back soon (I have started today)  :P

19
So... anything about a MOD for top categories yet?

20
Hi, this mod supports 4images 1.7.4? i have added the code for search.php after

//-----------------------------------------------------
//--- Show Search Results -----------------------------
//-----------------------------------------------------

but I just got a blank page, some idea?

My code is (i just have added your code):

22
La mia es Modelos de Costa Rica , compré una plantilla y le he agregado muchos MODS, pueden verlos en acción  :wink:

23
Discussion & Troubleshooting / Re: Changing the category_separator
« on: May 29, 2008, 12:33:22 AM »
it works perfect, thank you so much!

24
Dude, i got your idea, i tried but when i did the redirection on my .htaccess

RewriteRule fotos_de_chicas/details\.php$ http://www.ticas.co.cr/fotos_de_chicas/index.php [R=301,L]

I got a big problem, no one image show its details, every image was redirected in this way:

/details.php?image_id=376 --->  /index.php?image_id=376 (The home page always, people cannot see every image details)

 I think will be better to find exactly the place where the 302 redirection is called, i guess is called from some function of details.php, but I don't know which one

25
Installation, Update & Configuration / Re: 302 status code
« on: May 24, 2008, 04:06:27 AM »
Hello I got a question about it, i have delete some images, in some pages with good pagerank, but now when the search engines look for that pages there is a 302 temporary redirection to home page, but I want a 301 redirection in order to keep that pagerank of that deleted page, where can i change that 302 redirection?

PD: i want to that the server does not return a 404 code, because i will lost my pagerank, just the 301 redirection thanks so much!

26
Hello I got a question about it, i have delete some images, in some pages with good pagerank, but now when the search engines look for that pages there is a 302 temporary redirection to home page, but I want a 301 redirection in order to keep that pagerank of that deleted page, where can i change that 302 redirection?

PD: i want to that the server does not return a 404 code, because i will lost my pagerank, just the 301 redirection thanks so much!


27

   Rustynet, I like a lot your designs, but you need ti improve your position on google, bcz i couldn't find you with "4images templates", i'll buy you a design right now.
 Can you give some discount if I buy 2?. thanks

28
Mods & Plugins (Requests & Discussions) / Re: {new_images} in external site
« on: February 21, 2008, 06:13:22 PM »
cool. thanks!  :lol:

29
Mods & Plugins (Requests & Discussions) / Re: {new_images} in external site
« on: February 21, 2008, 01:51:40 AM »
that links doesn't work anymore

30
Discussion & Troubleshooting / Re: Changing the category_separator
« on: December 29, 2007, 02:15:24 AM »
yes, i want to do same thing, with a space(Eje: Chicas | lindas ), but without using &nbsp;, where is defined that variable in php code?

Pages: 1 [2] 3