Demo

Probiere ClanSphere aus und teste daran herum. Demo

Codepaste - Details
Weitere Infos zum Codepaste

Name Avatare in News Comments
Autor de Fr33z3m4n
CMS-Version ClanSphere 2007
Datei comments/functions.php
Datum 28.09.2007 um 13:32 Uhr
Beschreibung Mit diesem CodePaste kann man die Avatare der einzelnen User bie den News Comments anzeigen lassen
Alter Code Alter Code +-
 
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
1. / 2. / ... 
 function cs_comments_view($fid,$mod,$action,$sum,$asc true,$limit 0) { 

    
$cs_lang cs_translate('comments');

    global 
$account;
    
    
$class 'leftb';
    
$on_now cs_time() - 300
    
$on_week cs_time() - 604800;
    
$start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;
    
settype($start,'integer');
    
settype($fid,'integer');
    
settype($asc'boolean');
    
settype($limit'integer');

    
$data['lang']['comments'] = $cs_lang['comments'];
    
$data['comments']['sum'] = $sum;
    
$data['comments']['pages'] = cs_pages($mod,$action,$sum,$start,$fid);
    

    
$where "comments_mod = '" cs_sql_escape($mod) . "' AND comments_fid = '" $fid "'";
    
$from 'comments com INNER JOIN {pre}_users usr ON com.users_id = usr.users_id ';
    
$select 'com.comments_id AS comments_id, com.comments_ip AS comments_ip, com.comments_time AS comments_time, com.comments_text AS comments_text, com.comments_edit AS comments_edit, com.users_id AS users_id, usr.users_nick as users_nick, usr.users_laston as users_laston, usr.users_place AS users_place, usr.users_country AS users_country, usr.users_hidden AS users_hidden'
    
$order $asc == true 'comments_id ASC' 'comments_id DESC';
    
$limit = !empty($limit) ? $limit $account['users_limit'];
    
$cs_com cs_sql_select(__FILE__,$from,$select,$where,$order,$start,$limit);
    
$com_loop count($cs_com);
    for(
$run=0$run<$com_loop$run++) {

        
$class = ($class == 'leftb') ? 'leftc' 'leftb';
        
$current $start $run 1;

        
$on_now <= $cs_com[$run]['users_laston'] ? $icon 'green' $icon 'red';
          if(
$on_week>=$cs_com[$run]['users_laston']) {
            
$icon 'grey';
        }
        
        
$content[$run]['class'] = $class;
        
$content[$run]['img_url'] = 'symbols/countries/' $cs_com[$run]['users_country'] . '.png';
        
$content[$run]['users_link'] = cs_user($cs_com[$run]['users_id'], $cs_com[$run]['users_nick']);
        
$content[$run]['comments_time'] = cs_date('unix',$cs_com[$run]['comments_time'],1);
        
$content[$run]['users_status'] = $icon;
        
$content[$run]['users_laston'] = cs_date('unix',$cs_com[$run]['users_laston']);
        
$content[$run]['run'] = $asc == true ? ($run+1) : ($com_loop $run);

        
$content_place cs_secure($cs_com[$run]['users_place']);
        
$hidden explode(',',$cs_com[$run]['users_hidden']);
        if(
in_array('users_place',$hidden)) {
          
$content_place = ($account['access_users'] > OR $cs_com[$run]['users_id'] == $account['users_id']) ? cs_html_italic(1) . $content_place cs_html_italic(0) : '';
        }
        
        
$users_place = empty($content_place);
        if(empty(
$users_place)) {
        
$data['lang']['place'] = $cs_lang['place'];
        
$content[$run]['content_place'] = $cs_com[$run]['users_place'];
        } else {
        
$data['lang']['place'] = $cs_lang['place'];
        
$content[$run]['content_place'] = '-';
        }

        
        
$who "users_id = '" $cs_com[$run]['users_id'] . "'";
        
$count_user_com cs_sql_count(__FILE__,'comments',$who);
                

        
        
$data['lang']['posts'] = $cs_lang['posts'];
        
$content[$run]['posts'] = $count_user_com;
        
$content[$run]['current'] = $current;
        
$content[$run]['comments_text'] = cs_secure($cs_com[$run]['comments_text'],1,1,1,0,1);

        if(!empty(
$cs_com[$run]['comments_edit'])) {
            
$edits explode('/',$cs_com[$run]['comments_edit']);
            
$euser cs_link($edits[1],'users','view','id=' .$edits[0]);
            
$content[$run]['comments_edit'] = cs_html_br(3);
            
$content[$run]['comments_edit'] .= cs_html_italic(1);
            
$content[$run]['comments_edit'] .= sprintf($cs_lang['lastcom'],$euser,cs_date('unix',$edits[2],1),$edits[3]);
            
$content[$run]['comments_edit'] .= cs_html_italic(0);
        } else { 
$content[$run]['comments_edit'] = ''; }


        if(!empty(
$account['users_id'])) {
            
$content[$run]['edit_delete'] = cs_html_br(2);
            
$content[$run]['edit_delete'] .= cs_html_div(1,'float:right');
            
$img_quote cs_icon('editcut',16,$cs_lang['quote']);
            
$content[$run]['edit_delete'] .= cs_link($img_quote,$mod,'com_create','id=' $cs_com[$run]['comments_id'],0,$cs_lang['quote']);

            if(
$cs_com[$run]['users_id'] == $account['users_id'] OR $account['access_comments'] >= 4) {
                
$img_edit cs_icon('edit',16,$cs_lang['edit']);
                
$content[$run]['edit_delete'] .= cs_link($img_edit,$mod,'com_edit','id=' $cs_com[$run]['comments_id'],0,$cs_lang['edit']);
            }
            if(
$account['access_comments'] >= 5) {
                
$img_del cs_icon('editdelete',16,$cs_lang['remove']);
                
$content[$run]['edit_delete'] .=  cs_link($img_del,$mod,'com_remove','id=' $cs_com[$run]['comments_id'],0,$cs_lang['remove']);
            }
            
$content[$run]['edit_delete'] .= cs_html_div(0);
        }
        else { 
$content[$run]['edit_delete'] = ''; }
            
    }
    
    
$data['content'] = !empty($content) ? $content '';
    echo 
cs_subtemplate(__FILE__,$data,'comments','view');
}
######################################################
Neuer Code Neuer Code +-
 
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
1. / 2. / ... 
 function cs_comments_view($fid,$mod,$action,$sum,$asc true,$limit 0) { 

    
$cs_lang cs_translate('comments');

    global 
$account;
    
    
$class 'leftb';
    
$on_now cs_time() - 300
    
$on_week cs_time() - 604800;
    
$start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;
    
settype($start,'integer');
    
settype($fid,'integer');
    
settype($asc'boolean');
    
settype($limit'integer');

    
$data['lang']['comments'] = $cs_lang['comments'];
    
$data['comments']['sum'] = $sum;
    
$data['comments']['pages'] = cs_pages($mod,$action,$sum,$start,$fid);
    

    
$where "comments_mod = '" cs_sql_escape($mod) . "' AND comments_fid = '" $fid "'";
    
$from 'comments com INNER JOIN {pre}_users usr ON com.users_id = usr.users_id ';
    
    
$data['if']['news_ava'] = false;
    if(
$mod == 'news') {
        
$data['if']['news_ava'] = true;
        require_once(
'mods/board/functions.php');
        
$select 'com.comments_id AS comments_id, com.comments_ip AS comments_ip, com.comments_time AS comments_time, com.comments_text AS comments_text, com.comments_edit AS comments_edit, com.users_id AS users_id, usr.users_nick as users_nick, usr.users_laston as users_laston, usr.users_place AS users_place, usr.users_country AS users_country, usr.users_hidden AS users_hidden, usr.users_avatar AS users_avatar';
    } else {
        
$select 'com.comments_id AS comments_id, com.comments_ip AS comments_ip, com.comments_time AS comments_time, com.comments_text AS comments_text, com.comments_edit AS comments_edit, com.users_id AS users_id, usr.users_nick as users_nick, usr.users_laston as users_laston, usr.users_place AS users_place, usr.users_country AS users_country, usr.users_hidden AS users_hidden'
    }
    
$order $asc == true 'comments_id ASC' 'comments_id DESC';
    
$limit = !empty($limit) ? $limit $account['users_limit'];
    
$cs_com cs_sql_select(__FILE__,$from,$select,$where,$order,$start,$limit);
    
$com_loop count($cs_com);
    for(
$run=0$run<$com_loop$run++) {

        
$class = ($class == 'leftb') ? 'leftc' 'leftb';
        
$current $start $run 1;

        
$on_now <= $cs_com[$run]['users_laston'] ? $icon 'green' $icon 'red';
          if(
$on_week>=$cs_com[$run]['users_laston']) {
            
$icon 'grey';
        }
        
        
$content[$run]['class'] = $class;
        
$content[$run]['img_url'] = 'symbols/countries/' $cs_com[$run]['users_country'] . '.png';
        
$content[$run]['users_link'] = cs_user($cs_com[$run]['users_id'], $cs_com[$run]['users_nick']);
        
$content[$run]['comments_time'] = cs_date('unix',$cs_com[$run]['comments_time'],1);
        
$content[$run]['users_status'] = $icon;
        
$content[$run]['users_laston'] = cs_date('unix',$cs_com[$run]['users_laston']);
        
$content[$run]['run'] = $asc == true ? ($run+1) : ($com_loop $run);

        
$content_place cs_secure($cs_com[$run]['users_place']);
        
$hidden explode(',',$cs_com[$run]['users_hidden']);
        if(
in_array('users_place',$hidden)) {
          
$content_place = ($account['access_users'] > OR $cs_com[$run]['users_id'] == $account['users_id']) ? cs_html_italic(1) . $content_place cs_html_italic(0) : '';
        }
        
        if(
$mod == 'news') {
            
$content[$run]['users_avatar'] = getUserAvatar($cs_com[$run]['users_avatar']);
        }
        
        
$users_place = empty($content_place);
        if(empty(
$users_place)) {
        
$data['lang']['place'] = $cs_lang['place'];
        
$content[$run]['content_place'] = $cs_com[$run]['users_place'];
        } else {
        
$data['lang']['place'] = $cs_lang['place'];
        
$content[$run]['content_place'] = '-';
        }

        
        
$who "users_id = '" $cs_com[$run]['users_id'] . "'";
        
$count_user_com cs_sql_count(__FILE__,'comments',$who);
                

        
        
$data['lang']['posts'] = $cs_lang['posts'];
        
$content[$run]['posts'] = $count_user_com;
        
$content[$run]['current'] = $current;
        
$content[$run]['comments_text'] = cs_secure($cs_com[$run]['comments_text'],1,1,1,0,1);

        if(!empty(
$cs_com[$run]['comments_edit'])) {
            
$edits explode('/',$cs_com[$run]['comments_edit']);
            
$euser cs_link($edits[1],'users','view','id=' .$edits[0]);
            
$content[$run]['comments_edit'] = cs_html_br(3);
            
$content[$run]['comments_edit'] .= cs_html_italic(1);
            
$content[$run]['comments_edit'] .= sprintf($cs_lang['lastcom'],$euser,cs_date('unix',$edits[2],1),$edits[3]);
            
$content[$run]['comments_edit'] .= cs_html_italic(0);
        } else { 
$content[$run]['comments_edit'] = ''; }


        if(!empty(
$account['users_id'])) {
            
$content[$run]['edit_delete'] = cs_html_br(2);
            
$content[$run]['edit_delete'] .= cs_html_div(1,'float:right');
            
$img_quote cs_icon('editcut',16,$cs_lang['quote']);
            
$content[$run]['edit_delete'] .= cs_link($img_quote,$mod,'com_create','id=' $cs_com[$run]['comments_id'],0,$cs_lang['quote']);

            if(
$cs_com[$run]['users_id'] == $account['users_id'] OR $account['access_comments'] >= 4) {
                
$img_edit cs_icon('edit',16,$cs_lang['edit']);
                
$content[$run]['edit_delete'] .= cs_link($img_edit,$mod,'com_edit','id=' $cs_com[$run]['comments_id'],0,$cs_lang['edit']);
            }
            if(
$account['access_comments'] >= 5) {
                
$img_del cs_icon('editdelete',16,$cs_lang['remove']);
                
$content[$run]['edit_delete'] .=  cs_link($img_del,$mod,'com_remove','id=' $cs_com[$run]['comments_id'],0,$cs_lang['remove']);
            }
            
$content[$run]['edit_delete'] .= cs_html_div(0);
        }
        else { 
$content[$run]['edit_delete'] = ''; }
            
    }
    
    
$data['content'] = !empty($content) ? $content '';
    echo 
cs_subtemplate(__FILE__,$data,'comments','view');
}

######################################################
/themes/<-themesset->/comments/view.tpl
Zeile 10 einfügen
{if:news_ava}
    {
content:users_avatar}    <br />
{
stop:news_ava}
Zurück - Übersicht

Kommentare: 11
Seite [1]
maxX

19.12.2007

Ort: -
Beiträge: 35
# 1 - 28.09.2007 um 15:55 Uhr

Hab es ausprobiert,erhalte dann folgende Fehlermeldungen :( :

Notice: Undefined index: users_avatar in /usr/export/www/hosting/bratm4xe/mods/comments/functions.php on line 65

Fatal error: Call to undefined function cs_comments_add() in /usr/export/www/hosting/bratm4xe/mods/news/view.php on line 55
Fr33z3m4n ClanSphere Team

16.03.2022

Ort: Hamm
Beiträge: 11700
# 2 - 28.09.2007 um 15:59 Uhr

ahh sorry, hatte schreibfehler in der SQL Abfrage, bitte den unteren Code nochmals ersetzen.
Dodo

04.11.2012

Ort: -
Beiträge: 165
# 3 - 28.09.2007 um 16:33 Uhr

funzt,

hab aber das ################# und das darunter erst in die datei reinkopiert und dann gings net ^^
sehr gut!
Fr33z3m4n ClanSphere Team

16.03.2022

Ort: Hamm
Beiträge: 11700
# 4 - 29.09.2007 um 14:51 Uhr

gut das es funzt, kann ich ja ungetestet entfernen.
Neurologe

10.11.2016

Ort: Rieneck
Beiträge: 402
# 5 - 06.10.2007 um 21:15 Uhr

also bei der aktuellen version bekomm ich einige kleine probleme, liegt wohl daran das die bestätigungspage nicht mehr in dem sinn vorhanden ist wie vorher allerdings fehlt mir die zeit das zu verbessern, leider :(

mfg
neuro
Oden

01.08.2011

Ort: -
Beiträge: 12
# 6 - 17.10.2007 um 19:09 Uhr

-.- falsches forum sry


Zuletzt editiert von Oden, am 17.10.2007 um 19:11 Uhr (1x Editiert)
smokey78

22.12.2007

Ort: -
Beiträge: 14
# 7 - 03.12.2007 um 13:23 Uhr

funzt bei der 4.3er auch nicht!?


edit: ne, funzt bei mir kein bisschen


Zuletzt editiert von smokey78, am 03.12.2007 um 15:03 Uhr (1x Editiert)
Neurologe

10.11.2016

Ort: Rieneck
Beiträge: 402
# 8 - 01.01.2008 um 22:58 Uhr

müsste mal für 4.4 geschrieben werden ^^
Mr.Metzel

17.02.2008

Ort: -
Beiträge: 58
# 9 - 20.01.2008 um 13:53 Uhr

funzt nicht in 4.3? Schade -.-
Raido

01.05.2008

Ort: -
Beiträge: 3
# 10 - 30.04.2008 um 15:35 Uhr

Na super wie krieg ich dass dann wieder normal hin? Der alte code UND der neue code funktionieren nicht mehr.Welchen code mussich Jetzt daraun tun?
Fr33z3m4n ClanSphere Team

16.03.2022

Ort: Hamm
Beiträge: 11700
# 11 - 11.06.2008 um 16:06 Uhr

ist im aktuellem SVN als Standard eingebaut.

Bitte hier nicht mehr antworten, es wird hier nicht mehr nachgelesen !!!


Bitte Login benutzen, um Kommentare zu schreiben.