News - Features - Downloads - Forum - Team - Support - Switch View: Screen
Login - Registrierung - Passwort vergessen

Antworten: 3
Seite [1]
RaPiD


Geekboy




Beiträge: 1192
# Thema - 09.06.2009 um 19:04 Uhr
Hi ich versuche hier gerade für das forum der list.tpl ansicht ein Country funktion zu machen die man über (erstellen, edit) einstellen kann welches theart das Forum für eine sprache hat. Leider verstehe ich nicht zu viel php, wäre nett wenn mir einer weiter helfen könnte. Überall wo das (####################) ist habe ich von users modul eingebaut und einfach in board umgeschrieben.

mods/board/edit.php +-

 
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.
1. / 2. / ... 
<?php
// ClanSphere 2009 - www.clansphere.net
// $Id: edit.php 3009 2009-05-03 14:57:11Z hajo $

####################
include_once('lang/' $account['board_lang'] . '/countries.php');
####################

$cs_lang cs_translate('board');
$cs_post cs_post('id');
$cs_get cs_get('id');
$data = array();

$board_id = empty($cs_get['id']) ? $cs_get['id'];
if (!empty(
$cs_post['id']))  $board_id $cs_post['id'];

require_once(
'mods/categories/functions.php');

$board_pwdel 0;
$new_board_pwd '';
$data['if']['preview'] = false;



if(isset(
$_POST['submit']) OR isset($_POST['preview'])) {

  
$board['categories_id'] = empty($_POST['categories_name']) ? $_POST['categories_id'] : 
  
cs_categories_create('board',$_POST['categories_name']);
  
$board['board_access'] = $_POST['board_access'];
  
$board['board_name'] = $_POST['board_name'];
    
  
####################
  
$board['board_country'] = $_POST['board_country'];
  
####################
    
  
$board['board_text'] = $_POST['board_text'];
  
$board['board_read'] = isset($_POST['board_read']) ? $_POST['board_read'] : '';
  
$board['board_pwd'] = $_POST['new_board_pwd'];
  
$board['squads_id'] = $_POST['squads_id'];
  
$new_board_pwd $_POST['new_board_pwd']; 

  if(!empty(
$_POST['board_pwdel']))  
  
$board_pwdel $_POST['board_pwdel'];
  
$error '';

  if(empty(
$board['categories_id'])) 
    
$error .= $cs_lang['no_cat'] . cs_html_br(1);
  if(empty(
$board['board_name']))
    
$error .= $cs_lang['no_name'] . cs_html_br(1);
  if(empty(
$board['board_text'])) 
    
$error .= $cs_lang['no_text'] . cs_html_br(1);
}

else {
  
$cells 'categories_id, board_name, board_country, board_text, users_id, board_time, board_access, board_pwd, squads_id, board_read';
  
$board cs_sql_select(__FILE__,'board',$cells,"board_id = '" $board_id "'");
}

if(!isset(
$_POST['submit']) OR isset($_POST['preview']))
  
$data['head']['body'] = $cs_lang['body_edit'];
elseif(!empty(
$error))
  
$data['head']['body'] = $error;


if(isset(
$_POST['preview']) AND empty($error)) {
  
$data['if']['preview'] = TRUE;
  if(!empty(
$board['board_pwd'])) {
  
$data['prev']['icon'] = cs_html_img('symbols/board/password.png');
  }elseif(!empty(
$board['squads_id'])) {
  
$data['prev']['icon'] = cs_html_img('symbols/board/board_read_.png');
  }else{
  
$data['prev']['icon'] = cs_icon('password');
  }
 
$data['prev']['text'] = cs_secure($board['board_text'],1);
}


if(!empty(
$error) OR isset($_POST['preview']) OR !isset($_POST['submit'])) {
  
$data['data'] = $board;
  
$data['categories']['dropdown'] = cs_categories_dropdown2('board',$board['categories_id']); 
  
$data['abcode']['features'] = cs_abcode_features('board_text');
  
$data['access']['options'] = '';
  
$levels 0;
  while(
$levels 6) {
    
$board['board_access'] == $levels $sel $sel 0;
    
$data['access']['options'] .= cs_html_option($levels ' - ' $cs_lang['lev_' $levels],$levels,$sel);
    
$levels++;
  }    
  
$checked 'checked="checked"';
  
$data['check']['yes'] = !empty($board['board_read']) ? $checked '';
  
$data['check']['no'] = empty($board['board_read']) ? $checked '';
  
  
####################
  
$data['board']['country_url'] = cs_html_img('symbols/countries/' $cs_user['board_country'] . '.png',0,0,'id="country_1"');
  
####################

  
$matches[1] = $cs_lang['secure_stages'];
  
$matches[2] = $cs_lang['stage_1'] . $cs_lang['stage_1_text'] . cs_html_br(1);
  
$matches[2] .= $cs_lang['stage_2'] . $cs_lang['stage_2_text'] . cs_html_br(1);
  
$matches[2] .= $cs_lang['stage_3'] . $cs_lang['stage_3_text'] . cs_html_br(1);
  
$matches[2] .= $cs_lang['stage_4'] . $cs_lang['stage_4_text'];
  
$data['clip']['sec_level'] = cs_abcode_clip($matches);
  
$data['if']['pwd_remove'] = !empty($board['board_pwd']) ? TRUE FALSE;
  
$op_squads cs_sql_option(__FILE__,'squads');
  
$data['squads']['lang'] = $cs_lang[$op_squads['label']];
  
$data_squads cs_sql_select(__FILE__,'squads','squads_name,squads_id','squads_own=1','squads_name',0,0); 
  
$data['squads']['dropdown'] = cs_dropdown('squads_id','squads_name',$data_squads,$board['squads_id']);  
  
$data['board']['id'] = $board_id;
 echo 
cs_subtemplate(__FILE__,$data,'board','edit');
}
else {
  if(!empty(
$new_board_pwd)) {
    global 
$cs_db;
        if(
$cs_db['hash'] == 'md5')
            
$board['board_pwd'] = md5($new_board_pwd);
        elseif(
$cs_db['hash'] == 'sha1'
            
$board['board_pwd'] = sha1($new_board_pwd);
            
$sql_del 1;
    }
  if(!empty(
$board_pwdel)) {
    
$board['board_pwd'] = '';  
    
$sql_del 1;
  }
  if(!empty(
$sql_del)) {
    
$board_pws_sql cs_sql_select(__FILE__,'boardpws','boardpws_id',"board_id = '" $board_id "'",0,0,0);
    if(!empty(
$board_pws_sql)) {
      foreach(
$board_pws_sql AS $value) {
        
cs_sql_delete(__FILE__,'boardpws',$value['boardpws_id']);
      }
    }
  }
  
$board_cells array_keys($board);
  
$board_save array_values($board);
 
cs_sql_update(__FILE__,'board',$board_cells,$board_save,$board_id);
 
cs_redirect($cs_lang['changes_done'], 'board') ;


Zuletzt editiert von RaPiD am 09.06.2009 um 19:05 Uhr (1x Editiert)
Inaktiv
RaPiD
Thread-Ersteller


Geekboy




Beiträge: 1192
# Antwort: 1 - 09.06.2009 um 19:04 Uhr
themes/board/edit.tpl +-

<table class="forum" style="width:{page:width}" cellpadding="0" cellspacing="{page:cellspacing}">
<tr>
<td class="headb">{lang:mod_name} - {lang:head_edit}</td>
</tr>
<tr>
<td class="leftb">{head:body}</td>
</tr>
</table>
<br />

{if:preview}
<table class="forum" style="width:{page:width}" cellpadding="0" cellspacing="{page:cellspacing}">
<tr>
<td class="leftb" style="width:36px">{prev:icon}</td>
<td class="leftb">
<strong><a href="#">{data:board_name}</a></strong><br />
{prev:text}
</td>
<td class="leftb" style="width:60px">-</td>
<td class="leftb" style="width:60px">-</td>
<td class="leftb" style="width:160px">-</td>
</tr>
</table>
<br />
{stop:preview}

<form method="post" id="board_edit" action="{url:board_edit}">
<table class="forum" style="width:{page:width}" cellpadding="0" cellspacing="{page:cellspacing}">
<tr>
<td class="leftc" style="width:140px">{icon:kedit} {lang:name} *</td>
<td class="leftb"><input type="text" name="board_name" value="{data:board_name}" maxlength="200" size="50" /></td>
</tr>
<tr>
<td class="leftc">{icon:folder_yellow} {lang:category} *</td>
<td class="leftb">
{categories:dropdown}
</td>
</tr>
<tr>
<td class="leftc"> {icon:locale} {lang:country}</td>
<td class="leftb" colspan="2">
<select name="board_country" onchange="document.getElementById('country_1').src='{pa ge:path}symbols/countries/' + this.form.board_country.options[this.form.board_country.selectedIndex].value + '.png'">
{loop:country}
<option value="{country:short}"{country:selection}>{ country:full}</option>{stop:country}
</select>
{board:country_url}</td>

</tr>
<tr>
<td class="leftc">{icon:kate} {lang:text} *</td>
<td class="leftb">
{abcode:features}
<textarea class="rte_abcode" name="board_text" cols="50" rows="5" id="board_text">{data:board_text}</textarea>
</td>
</tr>
<tr>
<td class="leftc">{icon:access} {lang:access} *</td>
<td class="leftb" colspan="2">
<select name="board_access">
{access:options}
</select>
</td>
</tr>
<tr>
<td class="leftc">{icon:access} {lang:only_read} *</td>
<td class="leftb">
<input type="radio" name="board_read" value="1" {check:yes}/> {lang:yes}
<input type="radio" name="board_read" value="0" {check:no}/> {lang:no}
</td>
</tr>
<tr>
<td class="leftc">{icon:password} {lang:add_password}</td>
<td class="leftb">
<input name="new_board_pwd" value="" onkeydown="javascript:passwordcheck(this.value);" onkeyup="javascript:passwordcheck(this.value);" maxlength="30" size="30" type="password" /><br />
{lang:password2}
</td>
</tr>
<tr>
<td class="leftc">{icon:password} {lang:secure}</td>
<td class="leftb">
<div style="float:left; background-image:url({page:path}symbols/votes/vote03.png); width:100px; height:13px; margin-top:3px; margin-left:2px;">
<div style="float:left; background-image:url({page:path}symbols/votes/vote01.png); width:1px; height:13px;" id="pass_secure"></div>
</div>
<div style="float: left; padding-left: 3px; padding-top: 3px; display: none;" id="pass_stage_1">{lang:stage_1}</div>
<div style="float: left; padding-left: 3px; padding-top: 3px; display: none;" id="pass_stage_2">{lang:stage_2}</div>
<div style="float: left; padding-left: 3px; padding-top: 3px; display: none;" id="pass_stage_3">{lang:stage_3}</div>
<div style="float: left; padding-left: 3px; padding-top: 3px; display: none;" id="pass_stage_4">{lang:stage_4}</div>
<br />
{clip:sec_level}
</td>
</tr>
{if:pwd_remove}
<tr>
<td class="leftc">{icon:configure} {lang:more}</td>
<td class="leftb"><input type="checkbox" name="board_pwdel" value="1" /> {lang:board_pwddel}</td>
</tr>
{stop:pwd_remove}
<tr>
<td class="leftc">{icon:yast_group_add} {squads:lang}</td>
<td class="leftb">
{squads:dropdown}
</td>
</tr>
<tr>
<td class="leftc">{icon:ksysguard} {lang:options}</td>
<td class="leftb">
<input type="hidden" name="id" value="{board:id}" />
<input type="hidden" name="board_pwd" value="{data:board_pwd}" />
<input type="submit" name="submit" value="{lang:edit}" />
<input type="submit" name="preview" value="{lang:preview}" />
<input type="reset" name="reset" value="{lang:reset}" />
</td>
</tr>
</table>
</form>


Zuletzt editiert von RaPiD am 09.06.2009 um 19:47 Uhr (1x Editiert)
Inaktiv
|
duRiel ClanSphere Team


Weltmeister




Herkunft: Cambridge
Beiträge: 7300
# Antwort: 2 - 10.06.2009 um 14:20 Uhr
ok, ich habe noch nicht reingeguckt, aber was funktioniert denn schon und was nicht?


Inaktiv
|
RaPiD
Thread-Ersteller


Geekboy




Beiträge: 1192
# Antwort: 3 - 10.06.2009 um 14:42 Uhr
Hat sich geklärt, der SCHIRI macht es grade für mich gegen 10 euro


Inaktiv
|

Dieses Thema wurde von Ramires ClanSphere Team PM geschlossen.

Antworten: 3
Seite [1]




ClanSphere Project - Mailus - Imprint - Disclaimer - Scriptinfo