Jump to content


phpBB Dynamic Image Help


  • You cannot reply to this topic
No replies to this topic

#1 Phazon Eater

    P2L Jedi

  • Members
  • PipPipPip
  • 605 posts

Posted 02 March 2006 - 12:22 PM

I'm trying to get my image to display various stats, including the total tutorial views. However, right now it only displays the views for one tutorial and what I want it to do is display the total views for every topic in one forum.

The current preview can be found here: http://www.phazongra...m/forum/sig.php

Here is the code:

<?php
require dirname(__FILE__)."/config/myforum.config.inc.php";
$total_posts_sql = mysql_query("SELECT * FROM `artforum_posts`");
$total_posts_result = mysql_num_rows($total_posts_sql); 
$total_members_sql = mysql_query("SELECT * FROM `artforum_users`");
$total_members_result = mysql_num_rows($total_members_sql) - 1;
$photoshop_tutorials_sql = mysql_query("SELECT * FROM artforum_topics t WHERE t.forum_id = 17");
$photoshop_tutorials_result = mysql_num_rows($photoshop_tutorials_sql);
$rendering_tutorials_sql = mysql_query("SELECT * FROM artforum_topics t WHERE t.forum_id = 19");
$rendering_tutorials_result = mysql_num_rows($rendering_tutorials_sql);
$coding_tutorials_sql = mysql_query("SELECT * FROM artforum_topics t WHERE t.forum_id = 22");
$coding_tutorials_result = mysql_num_rows($coding_tutorials_sql);
$landscape_tutorials_sql = mysql_query("SELECT * FROM artforum_topics t WHERE t.forum_id = 21");
$landscape_tutorials_result = mysql_num_rows($landscape_tutorials_sql);
$other_tutorials_sql = mysql_query("SELECT * FROM artforum_topics t WHERE t.forum_id = 7");
$other_tutorials_result = mysql_num_rows($other_tutorials_sql);

$photoshop_tutorialviews_sql = "SELECT * FROM artforum_topics t WHERE t.forum_id = 17 Limit 0, $photoshop_tutorials_result";
$photoshop_tutorialviews_result = mysql_query($photoshop_tutorialviews_sql);
	while ($display = mysql_fetch_array($photoshop_tutorialviews_result))
			{
			$photoshop_tutorialviews = $display['topic_views'];
			}

$brushes_sql = mysql_query("SELECT * FROM artforum_topics t WHERE t.forum_id = 35");
$brushes_result = mysql_num_rows($brushes_sql);

Header ("Content-type: image/png");
$img_handle = imageCreateFromPNG("http://www.phazongraphics.com/forum/sig.png");
$color = ImageColorAllocate ($img_handle, 0, 300, 50);
$totalposts = "$total_posts_result";
$totalmembers = "$total_members_result";
$tutorials = "$photoshop_tutorials_result" + "$rendering_tutorials_result" + "$coding_tutorials_result" + "$landscape_tutorials_result" + "$other_tutorials_result";

$tutorialviews = "$photoshop_tutorialviews";

$brushes = "$brushes_result";
ImageString ($img_handle, 3, 300, 2,  "$totalposts posts", $color);
ImageString ($img_handle, 3, 300, 12,  "$totalmembers members", $color);
ImageString ($img_handle, 3, 300, 22,  "$tutorials tutorials", $color);
ImageString ($img_handle, 3, 300, 32,  "$tutorialviews tutorial views", $color);
ImageString ($img_handle, 3, 300, 42,  "$brushes brush packs", $color);
ImagePng ($img_handle);
ImageDestroy ($img_handle);
?>

Thanks for helping! :)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users