Verfasst: 11.08.2005 22:46
*schieb*
phpBB.de - Die deutsche phpBB-Community
https://www.phpbb.de/community/
BraveEagle hat geschrieben:Hi.
Gibt es eine Möglichkeit die Themen, die für normale User unsichtbaren sind in der Sig auch auszublenden?
Wohl eher nicht oder?
*edit*
noch was. Gibt es eine Möglichkeit, wenn die Titel des letzten Themas zu lang ist den nach einer gewissen Anzahl von Zeichen abzukürzen mit z.B. Punkten?
*edit2*
Noch eine Frage. Ich würde lieber eine *.gif haben. Was muss ich alles abändern, damit ich ein *.gif Bild nutzen kann? Hier mein bisheriger Code:
Code: Alles auswählen
<?php define('IN_PHPBB', true); $phpbb_root_path = './'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); // Get basic (usernames + totals) online // situation // $user_forum_sql = ( !empty($forum_id) ) ? "AND s.session_page = " . intval($forum_id) : ''; $sql = "SELECT u.username, u.user_id, s.session_logged_in, s.session_ip FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s WHERE u.user_id = s.session_user_id AND s.session_time >= ".( time() - 300 ) . " $user_forum_sql ORDER BY u.username ASC, s.session_ip ASC"; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql); } $logged_online = 0; $prev_user_id = 0; while( $row = $db->sql_fetchrow($result) ) { // User is logged in and therefor not a guest if ( $row['session_logged_in'] ) { // Skip multiple sessions for one user if ( $row['user_id'] != $prev_user_id ) { $logged_online++; } $prev_user_id = $row['user_id']; } } $sql = 'SELECT max(topic_id) FROM ' . TOPICS_TABLE; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Couldn\'t retrieve max of Topic_id data', '', __LINE__, __FILE__, $sql); } while ( $row = $db->sql_fetchrow($result)) { $max_topic_id = $row['max(topic_id)']; } $sql = 'SELECT topic_title FROM ' . TOPICS_TABLE . ' WHERE topic_id = ' . $max_topic_id; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Couldn\'t retrieve Topic_id data', '', __LINE__, __FILE__, $sql); } while ( $row = $db->sql_fetchrow($result)) { $latest_topic = $row['topic_title']; } $image = "myphpbb.png"; $im = imagecreatefrompng($image); $tc = ImageColorAllocate ($im, 0, 0, 0); $red = ImageColorAllocate ($im, 255, 0, 0); $blue = ImageColorAllocate ($im, 0, 0, 255); $total_users = get_db_stat('usercount'); $total_posts = get_db_stat('postcount'); $total_topics = get_db_stat('topiccount'); $j = strlen($total_users); $leerzeichen = $j*6+237; $newest_userdata = get_db_stat('newestuser'); $newest_user = $newest_userdata['username']; ImageString($im, 2, 99, 25, "Mitglieder: $total_users -", $tc); ImageString($im, 2, 208, 25, "Online: $logged_online", $red); ImageString($im, 2, 99, 35, "Letztes Thema:", $tc); ImageString($im, 2, 190, 35, "$latest_topic", $blue); ImageString($im, 2, 99, 45, "Gepostet: $total_posts Beiträge in $total_topics Themen", $tc); ImageString($im, 2, 99, 55, "Unser neustes Mitglied heißt: $newest_user", $tc); header("Content-Type: image/png"); Imagepng($im,'',100); ImageDestroy ($im); ?>
Also irgendwie gibt es dazu keine Lösung, aber theoretisch müsste man es doch so machen, wie in der Forenstatistik, kannst ja mal unten links in mein Forum schauen, denn da werden nur die Themen angezeigt, die für alle zugänglich sind....BraveEagle hat geschrieben:ein letztes mal *schieb* und *hoff*
Code: Alles auswählen
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
// Get basic (usernames + totals) online
// situation
//
$user_forum_sql = ( !empty($forum_id) ) ? "AND s.session_page = " . intval($forum_id) : '';
$sql = "SELECT u.username, u.user_id, s.session_logged_in, s.session_ip
FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
WHERE u.user_id = s.session_user_id
AND s.session_time >= ".( time() - 300 ) . "
$user_forum_sql
ORDER BY u.username ASC, s.session_ip ASC";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql);
}
$logged_online = 0;
$prev_user_id = 0;
while( $row = $db->sql_fetchrow($result) )
{
// User is logged in and therefor not a guest
if ( $row['session_logged_in'] )
{
// Skip multiple sessions for one user
if ( $row['user_id'] != $prev_user_id )
{
$logged_online++;
}
$prev_user_id = $row['user_id'];
}
}
// Modforen werden ausgeblendet
// get the forum_ids which aren't allowed
$sql = "SELECT forum_id
FROM ". FORUMS_TABLE ."
WHERE auth_view >= 3";
$result = $db->sql_query($sql);
if( !$result )
{
message_die(GENERAL_ERROR, "Could not get forum_ids", "", __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result))
{
$forum_ids[] = $row['forum_id'];
}
if ($forum_ids[0] != '')
{
$forum_ids = implode(" AND forum_id != ",$forum_ids);
$forum_ids = "forum_id != " . $forum_ids ;
$sql = 'SELECT max(topic_id)
FROM ' . TOPICS_TABLE . '
WHERE ' . $forum_ids;
}
else
{
$sql = 'SELECT max(topic_id)
FROM ' . TOPICS_TABLE;
}
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Couldn\'t retrieve max of Topic_id data', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result))
{
$max_topic_id = $row['max(topic_id)'];
}
$sql = 'SELECT topic_title
FROM ' . TOPICS_TABLE . '
WHERE topic_id = ' . $max_topic_id;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Couldn\'t retrieve Topic_id data', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result))
{
$latest_topic = $row['topic_title'];
// Laenge des letzten Topics begrenzen
if (strlen($latest_topic)>24) {
$latest_topic = substr($latest_topic,0,21) . '...';
}
}
$image = "myphpbb.png";
$im = imagecreatefrompng($image);
$std = ImageColorAllocate ($im, 0, 0, 0);
$total_users = get_db_stat('usercount');
$total_posts = get_db_stat('postcount');
$total_topics = get_db_stat('topiccount');
function unhtmlentities ($string)
{
$trans_tbl = get_html_translation_table (HTML_ENTITIES);
$trans_tbl = array_flip ($trans_tbl);
return strtr ($string, $trans_tbl);
}
$latest_topic = unhtmlentities($latest_topic);
$j = strlen($total_users);
$leerzeichen = $j*6+237;
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
$newest_user = unhtmlentities($newest_user);
// Laenge des neuesten Usernamens begrenzen
if (strlen($newest_user)>14) {
$newest_user = substr($newest_user,0,11) . '...';
}
ImageString($im, 3, 90, 20, "Aktuelle Statistik:", $std);
ImageString($im, 2, 90, 30, "Mitglieder: $total_users -", $std);
ImageString($im, 2, 199, 30, "Online: $logged_online", $std);
ImageString($im, 2, 90, 40, "Gepostet: $total_posts Beiträge in $total_topics Themen", $std);
ImageString($im, 2, 90, 50, "Letztes Thema: $latest_topic", $std);
ImageString($im, 2, 90, 60, "Unser neuestes Mitglied: $newest_user", $std);
header("Content-Type: image/png");
Imagepng($im,'',10);
ImageDestroy ($im);
?>
Kann da bitte wer helfen?mir ist nun aufgefallen, dass der die textfarbe immer der hintergrundfarbe des aktuellen templates anpasst... frag bitte mal, warum und wie man das aendern kann, dass der eine standardfarbe verwendet...
und dann frag bitte auch nochmal, was man tun muss, wenn man n anderen dateinamen (zb. bcforum.png) nutzen moechte... ein einfaches austauschen in der php datei fuehrt komischerweise dazu, dass nur noch die grafik aber kein text darauf angezeigt wird...
Code: Alles auswählen
$std = ImageColorAllocate ($im, 0, 0, 0);
Code: Alles auswählen
<?php
define('IN_PHPBB', true);
$phpbb_root_path = '../';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
// Get basic (usernames + totals) online
// situation
//
$user_forum_sql = ( !empty($forum_id) ) ? "AND s.session_page = " . intval($forum_id) : '';
$sql = "SELECT u.username, u.user_id, s.session_logged_in, s.session_ip
FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
WHERE u.user_id = s.session_user_id
AND s.session_time >= ".( time() - 300 ) . "
$user_forum_sql
ORDER BY u.username ASC, s.session_ip ASC";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql);
}
$logged_online = 0;
$prev_user_id = 0;
while( $row = $db->sql_fetchrow($result) )
{
// User is logged in and therefor not a guest
if ( $row['session_logged_in'] )
{
// Skip multiple sessions for one user
if ( $row['user_id'] != $prev_user_id )
{
$logged_online++;
}
$prev_user_id = $row['user_id'];
}
}
$sql = 'SELECT max(topic_id)
FROM ' . TOPICS_TABLE;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Couldn\'t retrieve max of Topic_id data', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result))
{
$max_topic_id = $row['max(topic_id)'];
}
$sql = 'SELECT topic_title
FROM ' . TOPICS_TABLE . '
WHERE topic_id = ' . $max_topic_id;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Couldn\'t retrieve Topic_id data', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result))
{
$latest_topic = $row['topic_title'];
}
$sitename = $board_config['sitename'];
$image = "../images/myphpbb.png";
$im = imagecreatefrompng($image);
$tc = ImageColorAllocate ($im, 148, 208, 255);
$red = ImageColorAllocate ($im, 255, 0, 0);
$blue = ImageColorAllocate ($im, 255, 255, 255);
$total_users = get_db_stat('usercount');
$total_posts = get_db_stat('postcount');
$total_topics = get_db_stat('topiccount');
$j = strlen($total_users);
$leerzeichen = $j*6+237;
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
ImageString($im, 3, 75, 2, "Statistik vom $sitename", $tc);
ImageString($im, 2, 75, 13, "Mitglieder: $total_users -", $tc);
ImageString($im, 2, 190, 13, "Online: $logged_online", $red);
ImageString($im, 2, 75, 46, "Letztes Thema:", $tc);
ImageString($im, 2, 170, 46, "$latest_topic", $blue);
ImageString($im, 2, 75, 35, "Gepostet: $total_posts Beiträge in $total_topics Themen", $tc);
ImageString($im, 2, 75, 24, "Unser neustes Mitglied heißt: $newest_user", $tc);
header("Content-Type: image/png");
Imagepng($im,'',100);
ImageDestroy ($im);
?>
Ja, das ist mir klar, wie und wo die Farbe definiert wird. Trotz allem will das bei unserem Skript irgendwie nicht funktionieren... Momentan stehe ich auf dem Schlauch, weshalb nicht... Bei uns wurde zum Beispiel auch nicht das rot oder blau angezeigt, obwohl wir es so definiert hatten... oder ist bei dir die Schrift auf dem Logo zur Zeit schwarz?!?Lantzius hat geschrieben:Die Standardfarbe wird in Deinem Code hierüber verwaltet:
Und das 0,0,0 steht normalerweise für schwarzCode: Alles auswählen
$std = ImageColorAllocate ($im, 0, 0, 0);
solltest Du diese Werte verändern auf z.B. 255, 255, 255 (weiß)
das sind die ganz normalen RGB Werte für farben
Ganz einfach! Aender das:Lantzius hat geschrieben:Welche Passage in Deinem Code steht ausschließlich für das Thema ?
Code: Alles auswählen
$sql = 'SELECT max(topic_id)
FROM ' . TOPICS_TABLE;
Code: Alles auswählen
// Modforen werden ausgeblendet
// get the forum_ids which aren't allowed
$sql = "SELECT forum_id
FROM ". FORUMS_TABLE ."
WHERE auth_view >= 3";
$result = $db->sql_query($sql);
if( !$result )
{
message_die(GENERAL_ERROR, "Could not get forum_ids", "", __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result))
{
$forum_ids[] = $row['forum_id'];
}
if ($forum_ids[0] != '')
{
$forum_ids = implode(" AND forum_id != ",$forum_ids);
$forum_ids = "forum_id != " . $forum_ids ;
$sql = 'SELECT max(topic_id)
FROM ' . TOPICS_TABLE . '
WHERE ' . $forum_ids;
}
else
{
$sql = 'SELECT max(topic_id)
FROM ' . TOPICS_TABLE;
}
Code: Alles auswählen
while ( $row = $db->sql_fetchrow($result))
{
$latest_topic = $row['topic_title'];
// Laenge des letzten Topics begrenzen
if (strlen($latest_topic)>24) {
$latest_topic = substr($latest_topic,0,21) . '...';
}
}
Code: Alles auswählen
function unhtmlentities ($string)
{
$trans_tbl = get_html_translation_table (HTML_ENTITIES);
$trans_tbl = array_flip ($trans_tbl);
return strtr ($string, $trans_tbl);
}
$latest_topic = unhtmlentities($latest_topic);
Code: Alles auswählen
<?php
define('IN_PHPBB', true);
$phpbb_root_path = '../';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
// Get basic (usernames + totals) online
// situation
//
$user_forum_sql = ( !empty($forum_id) ) ? "AND s.session_page = " . intval($forum_id) : '';
$sql = "SELECT u.username, u.user_id, s.session_logged_in, s.session_ip
FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
WHERE u.user_id = s.session_user_id
AND s.session_time >= ".( time() - 300 ) . "
$user_forum_sql
ORDER BY u.username ASC, s.session_ip ASC";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql);
}
$logged_online = 0;
$prev_user_id = 0;
while( $row = $db->sql_fetchrow($result) )
{
// User is logged in and therefor not a guest
if ( $row['session_logged_in'] )
{
// Skip multiple sessions for one user
if ( $row['user_id'] != $prev_user_id )
{
$logged_online++;
}
$prev_user_id = $row['user_id'];
}
}
// Modforen werden ausgeblendet
// get the forum_ids which aren't allowed
$sql = "SELECT forum_id
FROM ". FORUMS_TABLE ."
WHERE auth_view >= 3";
$result = $db->sql_query($sql);
if( !$result )
{
message_die(GENERAL_ERROR, "Could not get forum_ids", "", __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result))
{
$forum_ids[] = $row['forum_id'];
}
if ($forum_ids[0] != '')
{
$forum_ids = implode(" AND forum_id != ",$forum_ids);
$forum_ids = "forum_id != " . $forum_ids ;
$sql = 'SELECT max(topic_id)
FROM ' . TOPICS_TABLE . '
WHERE ' . $forum_ids;
}
else
{
$sql = 'SELECT max(topic_id)
FROM ' . TOPICS_TABLE;
}
while ( $row = $db->sql_fetchrow($result))
{
$latest_topic = $row['topic_title'];
// Laenge des letzten Topics begrenzen
if (strlen($latest_topic)>24) {
$latest_topic = substr($latest_topic,0,21) . '...';
}
}
function unhtmlentities ($string)
{
$trans_tbl = get_html_translation_table (HTML_ENTITIES);
$trans_tbl = array_flip ($trans_tbl);
return strtr ($string, $trans_tbl);
}
$latest_topic = unhtmlentities($latest_topic);
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Couldn\'t retrieve max of Topic_id data', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result))
{
$max_topic_id = $row['max(topic_id)'];
}
$sql = 'SELECT topic_title
FROM ' . TOPICS_TABLE . '
WHERE topic_id = ' . $max_topic_id;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Couldn\'t retrieve Topic_id data', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result))
{
$latest_topic = $row['topic_title'];
}
$sitename = $board_config['sitename'];
$image = "../images/myphpbb.png";
$im = imagecreatefrompng($image);
$tc = ImageColorAllocate ($im, 148, 208, 255);
$red = ImageColorAllocate ($im, 255, 0, 0);
$blue = ImageColorAllocate ($im, 255, 255, 255);
$total_users = get_db_stat('usercount');
$total_posts = get_db_stat('postcount');
$total_topics = get_db_stat('topiccount');
$j = strlen($total_users);
$leerzeichen = $j*6+237;
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
ImageString($im, 3, 75, 2, "Statistik vom $sitename", $tc);
ImageString($im, 2, 75, 13, "Mitglieder: $total_users -", $tc);
ImageString($im, 2, 190, 13, "Online: $logged_online", $red);
ImageString($im, 2, 75, 46, "Letztes Thema:", $tc);
ImageString($im, 2, 170, 46, "$latest_topic", $blue);
ImageString($im, 2, 75, 35, "Gepostet: $total_posts Beiträge in $total_topics Themen", $tc);
ImageString($im, 2, 75, 24, "Unser neustes Mitglied heißt: $newest_user", $tc);
header("Content-Type: image/png");
Imagepng($im,'',100);
ImageDestroy ($im);
?>
Code: Alles auswählen
[url=http://www.rechnungswesenforum.de][img]http://www.rechnungswesenforum.de/forum/sig.php][/img][/url]