affilaites probleem
ManageNews.template.php
Code (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
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
echo '
<form action="', $scripturl, '?action=news;sa=editaff" method="post" name="postmodify" id="postmodify">
<table width="85%" cellpadding="3" cellspacing="0" border="0" align="center" class="tborder">
<tr class="titlebg">
<th width="50%"></th>
<th align="left" width="45%">', affilaites, '</th>
<th align="center" width="5%"><input type="checkbox" class="check" onclick="invertAll(this, this.form);" /></th>
</tr>';
// Loop through all the current news items so you can edit/remove them.
foreach ($context['admin_current_aff'] as $admin_aff)
echo '
<tr class="windowbg2">
<td align="center">
<div style="margin-bottom: 2ex;"><textarea rows="3" cols="65" name="aff[]" style="width: 85%;">', $admin_aff['unparsed'], '</textarea></div>
</td><td align="left" valign="top">
<div style="overflow: auto; width: 100%; height: 10ex;">', $admin_aff['parsed'], '</div>
</td><td align="center">
<input type="checkbox" name="remove[]" value="', $admin_aff['id'], '" class="check" />
</td>
</tr>';
// This provides an empty text box to add a news item to the site.
echo '
<tr class="windowbg2">
<td align="center">
</td>
<td colspan="2" valign="bottom" align="right" style="padding: 1ex;">
<input type="submit" name="save_items" value="', $txt[10], '" /> <input type="submit" name="delete_selection" value="', $txt['editaff_remove_selected'], '" onclick="return confirm(\'', $txt['editaff_remove_confirm'], '\');" />
</td>
</tr>
</table>
<input type="hidden" name="sc" value="', $context['session_id'], '" />
</form>';
}
function template_email_members()
{
global $context, $settings, $options, $txt, $scripturl;
echo '
<form action="', $scripturl, '?action=news;sa=mailingcompose" method="post">
<table width="600" cellpadding="5" cellspacing="0" border="0" align="center" class="tborder">
<tr class="titlebg">
<td>', $txt[6], '</td>
</tr><tr class="windowbg">
<td class="smalltext" style="padding: 2ex;">', $txt['smf250'], '</td>
</tr><tr>
<td class="windowbg2">';
foreach ($context['groups'] as $group)
echo '
<label for="who[', $group['id'], ']"><input type="checkbox" name="who[', $group['id'], ']" id="who[', $group['id'], ']" value="', $group['id'], '" checked="checked" class="check" /> ', $group['name'], '</label> <i>(', $group['member_count'], ')</i><br />';
echo '
<br />
<label for="checkAllGroups"><input type="checkbox" id="checkAllGroups" checked="checked" onclick="invertAll(this, this.form, \'who\');" class="check" /> <i>', $txt[737], '</i></label><br />
<hr />
</td>
</tr><tr>
<td class="windowbg2">';
if ($context['can_send_pm'])
echo '
<label for="sendPM"><input type="checkbox" name="sendPM" id="sendPM" value="1" class="check" /> ', $txt['email_as_pms'], '</label><br />';
echo '
<label for="email_force"><input type="checkbox" name="email_force" id="email_force" value="1" class="check" /> ', $txt['email_force'], '</label>
</td>
</tr><tr>
<td class="windowbg2" style="padding-bottom: 1ex;" align="center">
<input type="submit" value="', $txt[65], '" />
</td>
</tr>
</table>
<input type="hidden" name="sc" value="', $context['session_id'], '" />
</form>';
<form action="', $scripturl, '?action=news;sa=editaff" method="post" name="postmodify" id="postmodify">
<table width="85%" cellpadding="3" cellspacing="0" border="0" align="center" class="tborder">
<tr class="titlebg">
<th width="50%"></th>
<th align="left" width="45%">', affilaites, '</th>
<th align="center" width="5%"><input type="checkbox" class="check" onclick="invertAll(this, this.form);" /></th>
</tr>';
// Loop through all the current news items so you can edit/remove them.
foreach ($context['admin_current_aff'] as $admin_aff)
echo '
<tr class="windowbg2">
<td align="center">
<div style="margin-bottom: 2ex;"><textarea rows="3" cols="65" name="aff[]" style="width: 85%;">', $admin_aff['unparsed'], '</textarea></div>
</td><td align="left" valign="top">
<div style="overflow: auto; width: 100%; height: 10ex;">', $admin_aff['parsed'], '</div>
</td><td align="center">
<input type="checkbox" name="remove[]" value="', $admin_aff['id'], '" class="check" />
</td>
</tr>';
// This provides an empty text box to add a news item to the site.
echo '
<tr class="windowbg2">
<td align="center">
</td>
<td colspan="2" valign="bottom" align="right" style="padding: 1ex;">
<input type="submit" name="save_items" value="', $txt[10], '" /> <input type="submit" name="delete_selection" value="', $txt['editaff_remove_selected'], '" onclick="return confirm(\'', $txt['editaff_remove_confirm'], '\');" />
</td>
</tr>
</table>
<input type="hidden" name="sc" value="', $context['session_id'], '" />
</form>';
}
function template_email_members()
{
global $context, $settings, $options, $txt, $scripturl;
echo '
<form action="', $scripturl, '?action=news;sa=mailingcompose" method="post">
<table width="600" cellpadding="5" cellspacing="0" border="0" align="center" class="tborder">
<tr class="titlebg">
<td>', $txt[6], '</td>
</tr><tr class="windowbg">
<td class="smalltext" style="padding: 2ex;">', $txt['smf250'], '</td>
</tr><tr>
<td class="windowbg2">';
foreach ($context['groups'] as $group)
echo '
<label for="who[', $group['id'], ']"><input type="checkbox" name="who[', $group['id'], ']" id="who[', $group['id'], ']" value="', $group['id'], '" checked="checked" class="check" /> ', $group['name'], '</label> <i>(', $group['member_count'], ')</i><br />';
echo '
<br />
<label for="checkAllGroups"><input type="checkbox" id="checkAllGroups" checked="checked" onclick="invertAll(this, this.form, \'who\');" class="check" /> <i>', $txt[737], '</i></label><br />
<hr />
</td>
</tr><tr>
<td class="windowbg2">';
if ($context['can_send_pm'])
echo '
<label for="sendPM"><input type="checkbox" name="sendPM" id="sendPM" value="1" class="check" /> ', $txt['email_as_pms'], '</label><br />';
echo '
<label for="email_force"><input type="checkbox" name="email_force" id="email_force" value="1" class="check" /> ', $txt['email_force'], '</label>
</td>
</tr><tr>
<td class="windowbg2" style="padding-bottom: 1ex;" align="center">
<input type="submit" value="', $txt[65], '" />
</td>
</tr>
</table>
<input type="hidden" name="sc" value="', $context['session_id'], '" />
</form>';
ManageNews.php
Code (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
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
function Editaff()
{
global $txt, $modSettings, $context, $db_prefix, $sourcedir, $user_info;
require_once($sourcedir . '/Subs-Post.php');
// The 'remove selected' button was pressed.
if (!empty($_POST['delete_selection']) && !empty($_POST['remove']))
{
checkSession();
// Store the news temporarily in this array.
$temp_aff = explode("\n", $modSettings['aff']);
// Remove the items that were selected.
foreach ($temp_aff as $i => $aff)
if (in_array($i, $_POST['remove']))
unset($temp_aff[$i]);
// Update the database.
updateSettings(array('aff' => addslashes(implode("\n", $temp_aff))));
logAction('aff');
}
// The 'Save' button was pressed.
elseif (!empty($_POST['save_items']))
{
checkSession();
foreach ($_POST['aff'] as $i => $aff)
{
if (trim($aff) == '')
unset($_POST['aff'][$i]);
else
preparsecode($_POST['aff'][$i]);
}
// Send the new news to the database.
updateSettings(array('aff' => implode("\n", $_POST['aff'])));
// Log this into the moderation log.
logAction('aff');
}
// Ready the current news.
foreach (explode("\n", $modSettings['aff']) as $id => $line)
$context['admin_current_aff'][$id] = array(
'id' => $id,
'unparsed' => htmlspecialchars(un_preparsecode($line)),
'parsed' => preg_replace('~<([/]?)form[^>]*?[>]*>~i', '<em class="smalltext"><$1form></em>', parse_bbc($line)),
);
$context['sub_template'] = 'edit_aff';
$context['page_title'] = edite aff;
}
{
global $txt, $modSettings, $context, $db_prefix, $sourcedir, $user_info;
require_once($sourcedir . '/Subs-Post.php');
// The 'remove selected' button was pressed.
if (!empty($_POST['delete_selection']) && !empty($_POST['remove']))
{
checkSession();
// Store the news temporarily in this array.
$temp_aff = explode("\n", $modSettings['aff']);
// Remove the items that were selected.
foreach ($temp_aff as $i => $aff)
if (in_array($i, $_POST['remove']))
unset($temp_aff[$i]);
// Update the database.
updateSettings(array('aff' => addslashes(implode("\n", $temp_aff))));
logAction('aff');
}
// The 'Save' button was pressed.
elseif (!empty($_POST['save_items']))
{
checkSession();
foreach ($_POST['aff'] as $i => $aff)
{
if (trim($aff) == '')
unset($_POST['aff'][$i]);
else
preparsecode($_POST['aff'][$i]);
}
// Send the new news to the database.
updateSettings(array('aff' => implode("\n", $_POST['aff'])));
// Log this into the moderation log.
logAction('aff');
}
// Ready the current news.
foreach (explode("\n", $modSettings['aff']) as $id => $line)
$context['admin_current_aff'][$id] = array(
'id' => $id,
'unparsed' => htmlspecialchars(un_preparsecode($line)),
'parsed' => preg_replace('~<([/]?)form[^>]*?[>]*>~i', '<em class="smalltext"><$1form></em>', parse_bbc($line)),
);
$context['sub_template'] = 'edit_aff';
$context['page_title'] = edite aff;
}
index.template
Code (php)
1
2
3
4
5
6
2
3
4
5
6
echo '
<div class="headertitles" style="width: 260px;"><img src="', $settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="width: 260px; position: relative; background-image: url(', $settings['images_url'], '/box_bg.gif);"> <img src="', $settings['images_url'], '/', $context['user']['language'], '/aff.gif" style="position: absolute; left: -1px; top: -16px;" alt="" />
<div style="height: 50px; overflow: auto; padding: 5px;" class="smalltext">', $context['random_aff_line'], '</div>
</td>
<div class="headertitles" style="width: 260px;"><img src="', $settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="width: 260px; position: relative; background-image: url(', $settings['images_url'], '/box_bg.gif);"> <img src="', $settings['images_url'], '/', $context['user']['language'], '/aff.gif" style="position: absolute; left: -1px; top: -16px;" alt="" />
<div style="height: 50px; overflow: auto; padding: 5px;" class="smalltext">', $context['random_aff_line'], '</div>
</td>
Gewijzigd op 19/10/2005 16:43:00 door Anton VE
Er zijn nog geen reacties op dit bericht.