Demo

Probiere ClanSphere aus und teste daran herum. Demo


Antworten: 15
Seite [1]
Dafoxx


King for a day





Beiträge: 244
# Thema - 08.02.2013 um 10:15 Uhr
Hallo zusammen,
Ich suche nach einer Möglichkeit, auf das hochgeladene Kategoriebild in der board_list.tpl zuzugreifen.
Oder allgemein nach dem Ort, in der das Kategoriebild einer Forums-Kategorie angezeigt wird.
habs mit url({page:path}{board:url_catimg} probiert, ganz nach dem Vorbild der news_recent, leider ohne Erfolg. Idee hinter dem ganzen ist eine Verschönerung des Forums durch jeweilige Hintergrund-Bilder für die einzelnen Kategorien.

Über Hilfe würde ich mich freuen.

url: http://hellsbears.abgefoxt.de/index.php?mod=board&action=list
Inaktiv
palle ClanSphere Team

Supporter
Supporter




Beiträge: 3073
# Antwort: 1 - 08.02.2013 um 10:17 Uhr
Oh, Dafoxx da würde ich dich bitten zuerst die Foren Suche zu benutzten.
Da gibt es bereits einen Paste für.

Gruß


------------------
I like the part where it says 'nyan'



Zuletzt editiert von palle ClanSphere Team am 08.02.2013 um 10:18 Uhr (1x Editiert)
Inaktiv
|
Dafoxx
Thread-Ersteller


King for a day





Beiträge: 244
# Antwort: 2 - 08.02.2013 um 10:21 Uhr
Danke für den Hinweis. Ich hatte das Forum schon durchsucht, leider anscheinend mit den flaschen Suchwörtern (catimg, board_list, board, Forum, Kategorie, Kategoriebild etc.).
Das einzige Thread mit eine ähnlichen Fragestellung das ich fand war leider eher Lösungsarm angesetzt (http://www.csphere.eu/forum/board/thread/where/14377)
Über einen Link würde ich mich sehr freuen.


Zuletzt editiert von Dafoxx am 08.02.2013 um 10:24 Uhr (1x Editiert)
Inaktiv
|
palle ClanSphere Team

Supporter
Supporter




Beiträge: 3073
# Antwort: 3 - 08.02.2013 um 10:25 Uhr
http://www.csphere.eu/forum/board/thread/where/10013


------------------
I like the part where it says 'nyan'



Inaktiv
|
Dafoxx
Thread-Ersteller


King for a day





Beiträge: 244
# Antwort: 4 - 08.02.2013 um 10:35 Uhr
Vielen Dank, leider funktioniert dieser Paste anscheinend nicht mehr.
Meine geänderte mods/board/list.php:
mehr... +-
 
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.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
1. / 2. / ... 
<?php
// ClanSphere 2010 - www.clansphere.net
// $Id$

$cs_lang cs_translate('board');

$options cs_sql_option(__FILE__'board');

require 
'mods/categories/functions.php';
require_once 
'mods/board/functions.php';
 
$data = array();

$unread_array = array();

if(!empty(
$account['users_id'])) {

  
# clear old read data that is no longer needed for checks
  
$cs_usertime cs_sql_select(__FILE__'users''users_readtime'"users_id = '" $account["users_id"] . "'");
  
$cs_readtime cs_time() - $cs_usertime['users_readtime'];
  
cs_sql_query(__FILE__"DELETE FROM {pre}_read WHERE users_id = '" $account['users_id'] . "' AND read_since < '" $cs_readtime "'");

  
# fetch unread threads grouped per board for later checks
  
$tables 'threads thr LEFT JOIN {pre}_read red ON thr.threads_id = red.threads_id AND red.users_id = ' $account['users_id'];
  
$needed "thr.threads_last_time > '" $cs_readtime "' AND (red.threads_id IS NULL OR thr.threads_last_time > red.read_since)" .
          
' AND thr.threads_ghost = 0 GROUP BY thr.board_id';
  
$values 'thr.board_id AS board_id';
  
$unread cs_sql_select(__FILE__$tables$values$needed000);
  
$unread is_array($unread) ? $unread : array();
  foreach(
$unread AS $untop => $unboard) {
    
$unread_array['' $unboard['board_id'] . ''] = 0;
  }
}

$categories_id = empty($_GET['id']) ? : (int)$_GET['id'];

$where "categories_mod = 'board' AND categories_access <= " $account['access_board'];
$select 'categories_name, categories_id, categories_subid. categories_picture';
$order 'categories_subid ASC, categories_order ASC, categories_name ASC';
$data['categories'] = cs_catsortcs_sql_select(__FILE__'categories'$select$where$order00), $categories_id);
$count_categories = empty($data['categories']) ? count($data['categories']); 

$data['if']['category'] = empty($categories_id) ? false true;

$data['category']['name'] = !empty($categories_id) ? $data['categories'][0]['categories_name'] : '';

for (
$run_1 0$run_1 $count_categories$run_1++) {
$data['categories'][$run_1]['if']['catimg'] = empty($data['categories'][$run_1]['categories_picture']) ? false true;
 
$data['categories'][$run_1]['catimg'] = empty($data['categories'][$run_1]['if']['catimg']) ? '' cs_html_img('uploads/categories/' $data['categories'][$run_1]['categories_picture']);

  
$data['categories'][$run_1]['list_url'] = cs_url('board''list''id=' $data['categories'][$run_1]['categories_id']);

  
$from "board boa LEFT JOIN {pre}_read red ON boa.board_last_threadid = red.threads_id AND red.users_id = " $account['users_id'] .
          
" LEFT JOIN {pre}_members mem ON boa.squads_id = mem.squads_id AND mem.users_id = " $account['users_id'];
  
$select 'boa.board_id AS board_id, boa.board_name AS board_name, boa.board_text AS board_text, boa.board_pwd AS board_pwd, ' .
            
'boa.board_threads AS board_threads, boa.board_comments AS board_comments, boa.board_access AS board_access,' .
            
'boa.board_last_time AS board_last_time, boa.board_last_user AS board_last_user, boa.board_last_userid AS board_last_userid,' 
            
'boa.board_last_thread AS board_last_thread, boa.board_last_threadid AS board_last_threadid, red.read_since AS read_since';
  
$where "categories_id = '" $data['categories'][$run_1]['categories_id'] . "' AND (board_access <= " .
           
$account['access_board'] . " OR mem.users_id = " $account['users_id'] . ")";
  
$order 'board_order ASC, board_name ASC';

  
$data['categories'][$run_1]['board'] = cs_sql_select(__FILE__$from$select$where$order00);

  if (empty(
$data['categories'][$run_1]['board']))
    
$data['categories'][$run_1]['board'] = array();

  
$data['categories'][$run_1]['blank'] = ''
  
$data['categories'][$run_1]['iconwidth'] = 36
  for (
$i 0$i $data['categories'][$run_1]['layer']; $i++) {
    
$data['categories'][$run_1]['blank'] .= '   » '
    
$data['categories'][$run_1]['iconwidth'] += 20
  }
  
  if (
$data['categories'][$run_1]['layer'] == || !empty($options['list_subforums'])) {
    
$data['categories'][$run_1]['if']['small_subforums'] = false;
    
$count_boards count($data['categories'][$run_1]['board']);

    for (
$run_2 0$run_2 $count_boards$run_2++) {
      
$board $data['categories'][$run_1]['board'][$run_2];
      
$board['listcat_url'] = cs_url('board''listcat''id=' $board['board_id']);

      
$check_pw 1;
      if (!empty(
$board['board_pwd'])) {
        
$pw_where 'users_id = "' $account['users_id'] . '" AND board_id = "' $board['board_id'] . '"';
        
$check_pw cs_sql_count(__FILE__'boardpws'$pw_where);
      }

      if (empty(
$check_pw)) {
        
$icon 'password';
      } else {
        
$icon 'board_read_';
      }

      if (!empty(
$check_pw)) {
        if (isset(
$unread_array['' $board['board_id'] . ''])) {
          
$icon 'board_unread_';
        }
      }

      
$board['icon'] = cs_html_img('symbols/board/' $icon '.png');
      
$board['board_text'] = cs_secure($board['board_text'], 1);

      
# new - set board_last_* content if empty
      
if(empty($board['board_last_threadid']) AND !empty($board['board_threads'])) {
        include_once 
'mods/board/repair.php';
        
$new cs_board_last($board['board_id']);
        
$board is_array($new) ? array_merge($board$new) : $board;
      }

      if(!empty(
$board['board_last_threadid']) and !empty($check_pw)) {
        
$board['last_name'] = cs_secure($board['board_last_thread']);
        
$board['board_last_id'] = $board['board_last_threadid'];

        if (empty(
$board['board_last_time']))
          
$board['last_time'] = '';
        else
          
$board['last_time'] = cs_date('unix'$board['board_last_time'], 1);

        if (empty(
$board['board_last_userid']))
          
$board['last_usernick'] = empty($board['board_last_user']) ? '-' cs_secure($board['board_last_user']);
        else
          
$board['last_usernick'] = cs_user($board['board_last_userid'], $board['board_last_user']);

        
$board['of'] = $cs_lang['of'];
      }
      else {
        if(empty(
$check_pw)) {
          
$board['board_threads'] = '-';
          
$board['board_comments'] = '-';
        }
        
$board['last_name'] = '';
        
$board['board_last_id'] = '';
        
$board['last_time'] = '';
        
$board['last_usernick'] = '';
        
$board['board_last_userid'] = '';
        
$board['of'] = '';
      }

      
$board['last_url'] = cs_url('board''thread''where=' $board['board_last_threadid'] . '&start=' last_comment($board['board_last_threadid'], $account["users_id"], $account['users_limit']));
      
$board['user_url'] = cs_url('users''view''id=' $board['board_last_userid']);
      
$board['board_name'] = cs_secure($board['board_name']);
    
      
      
$data['categories'][$run_1]['board'][$run_2] = $board;
    }
  } else {
    
$data['categories'][$run_1]['subboard'] = $data['categories'][$run_1]['board'];
    
$data['categories'][$run_1]['board'] = array();
    
$data['categories'][$run_1]['if']['small_subforums'] = true;
    
$count_boards count($data['categories'][$run_1]['subboard']);
    
$count_boards_less $count_boards 1;
    
    for (
$j 0$j $count_boards$j++) {
      
$data['categories'][$run_1]['subboard'][$j]['comma'] = $j != $count_boards_less ', ' '';
    }
  }
}

$data['head']['message'] = cs_getmsg();

echo 
cs_subtemplate(__FILE__$data'board''list',1);


Um genau zu sein funktioniert das Forum so gar nicht mehr :(
Vorweg: ich kenne mich mit php leider nicht aus.

edit: gemeint war natürlich die list.php.


Zuletzt editiert von Dafoxx am 08.02.2013 um 11:39 Uhr (3x Editiert)
Inaktiv
|
ev0lution


Geekboy





Beiträge: 1102
# Antwort: 5 - 08.02.2013 um 11:34 Uhr
das ist nicht die list.tpl sondern die list.php ...

da stimmt auch was bei dir nicht

categories_subid. hast du ein punkt anstatt ein komma hinter

nicht
$select = 'categories_name, categories_id, categories_subid. categories_picture';
sondern
$select = 'categories_name, categories_id, categories_subid, categories_picture';

schau ma obs daran liegt


------------------


Zuletzt editiert von ev0lution am 08.02.2013 um 11:40 Uhr (1x Editiert)
Inaktiv
|
palle ClanSphere Team

Supporter
Supporter




Beiträge: 3073
# Antwort: 6 - 08.02.2013 um 11:41 Uhr
Der Paste muss funktionieren, ich hoffe du hast Jam sein Kommentar beachtet.
Ansonsten begebe dich bitte im Debug Modus dort wird dir dein Fehler angezeigt.
Aber evolution müsste oben schon den Fehler gefunden haben.


------------------
I like the part where it says 'nyan'



Zuletzt editiert von palle ClanSphere Team am 08.02.2013 um 11:42 Uhr (1x Editiert)
Inaktiv
|
ev0lution


Geekboy





Beiträge: 1102
# Antwort: 7 - 08.02.2013 um 11:43 Uhr
ach ich hasse edits ..... sry palle wollt nich spammen


------------------


Zuletzt editiert von ev0lution am 08.02.2013 um 11:44 Uhr (1x Editiert)
Inaktiv
|
Dafoxx
Thread-Ersteller


King for a day





Beiträge: 244
# Antwort: 8 - 08.02.2013 um 12:06 Uhr
Herzlichen Dank. Das klappt soweit schonmal.
Nun die nächste hoffentlich leicht zu beantwortende Frage (auch wenn ich im Forum dazu nichts fand):
Wie mache ich aus dem Platzhalter {categories:catimg} einen funktionierenden Link zum jeweiligen Bild?
Die Intention ist, es als Hintergrundbild zu nutzen. Ich versuchte es bisher mit
 
1.
2.
3.
1. / 2. / ... 
 style="background:url({page:path}{url:categories_catimg}) "
und
style
="background:url({page:path}{catimg:url})"

was mir jedoch ein style="background:url(/m[0] board - m[1] url_catimg - );" ausgibt.
Ich vermute es fehlt auch dafür eine Funktion in der list.php, irgendetwas Richtung
 
1.
1. / 2. / ... 
   $board[$run]['url_catimg'] = empty($board[$run]['if']['catimg']) ? '' 'uploads/categories/' $board[$run]['categories_picture'];

Wäre super wenn Ihr da auch noch eine Lösung für hättet.

MfG


Zuletzt editiert von Dafoxx am 08.02.2013 um 12:07 Uhr (3x Editiert)
Inaktiv
|
palle ClanSphere Team

Supporter
Supporter




Beiträge: 3073
# Antwort: 9 - 08.02.2013 um 12:32 Uhr
Deine erfundenen Platzhalter existieren nicht.
DIe Zeile wird mit {board:url_catimg} aufgerufen.


------------------
I like the part where it says 'nyan'



Inaktiv
|
Dafoxx
Thread-Ersteller


King for a day





Beiträge: 244
# Antwort: 10 - 08.02.2013 um 12:46 Uhr
Danke für die Antwort.
Sollte ich dich richtig verstanden haben, sollte also {board:url_catimg} eine Url zu dem Kategoriebild ausgeben.
Dies hatte ich zuvor auch schon versucht, leider vorher wie jetzt ohne Erfolg.
 
1.
1. / 2. / ... 
 {board:url_catimg}
gibt
 
1.
1. / 2. / ... 
 m[0board m[1url_catimg
aus.
Ich suche, um präzise zu sein, nach einem Platzhalter, der mir zb /uploads/categories/picture-14.jpg ausgibt.
MfG


Zuletzt editiert von Dafoxx am 08.02.2013 um 12:48 Uhr (1x Editiert)
Inaktiv
|
palle ClanSphere Team

Supporter
Supporter




Beiträge: 3073
# Antwort: 11 - 08.02.2013 um 15:48 Uhr
Paste mal bitte beiden Dateien hier.


------------------
I like the part where it says 'nyan'



Inaktiv
|
Dafoxx
Thread-Ersteller


King for a day





Beiträge: 244
# Antwort: 12 - 08.02.2013 um 17:43 Uhr
Sehr gerne:
in der list.tpl funktioniert der Platzhalter {categories:catimg}, der einen <img>-Tag ausgibt)
http://paste.bradleygill.com/index.php?paste_id=3710 (list.tpl)
http://paste.bradleygill.com/index.php?paste_id=3709 (list.php)
Für das "hier" pasten sind die Dateien leider zu lang.


Inaktiv
|
palle ClanSphere Team

Supporter
Supporter




Beiträge: 3073
# Antwort: 13 - 08.02.2013 um 19:44 Uhr
 
1.
1. / 2. / ... 
 $data['categories'][$run_1]['catimg'] = empty($data['categories'][$run_1]['if']['catimg']) ? '' cs_html_img('uploads/categories/' $data['categories'][$run_1]['categories_picture']);

ersetzten gegen
 
1.
1. / 2. / ... 
 $data['categories'][$run_1]['catimg'] = empty($data['categories'][$run_1]['categories_picture']) ? '' cs_secure($data['categories'][$run_1]['categories_picture']);


und
 
1.
1. / 2. / ... 
 <td class="leftc" colspan="5" style="background:url({FEHLENDER PLATZHALTER});">

durch
 
1.
1. / 2. / ... 
 <td class="leftc" colspan="5" style="background:url({page:path}uploads/categories/{categories:catimg});">


Die empty(); Überprüfung ist eigentlich hinfällig, da man so wie der Platzhalter in der Theme Datei eingebettet ist davon ausgehen muss, das immer ein Bild vorhanden ist.


------------------
I like the part where it says 'nyan'



Zuletzt editiert von palle ClanSphere Team am 08.02.2013 um 19:45 Uhr (1x Editiert)
Inaktiv
|
Dafoxx
Thread-Ersteller


King for a day





Beiträge: 244
# Antwort: 14 - 08.02.2013 um 20:28 Uhr
Funktioniert perfekt.
Ich bedanke mich recht herzlich und wünsche allen beteiligten ein schönes Wochenende.
MfG
Fox


Inaktiv
|
Deaktiviert

Supporter
Supporter



Beiträge: 1287
# Antwort: 15 - 08.02.2013 um 20:34 Uhr
Gleichfalls!


Inaktiv
|

Dieses Thema wurde von Deaktiviert PM geschlossen.

Antworten: 15
Seite [1]