DE - Allgemeiner SupportPremium-Funktion (only if logged in)?


15.04.2012, 20:20 - TheGame980 - webSPELL newbie - 8 Posts
Hallo,

ich habe eine kleine "Premium-Kauf" Page (Premium für einen GameServer).
Jedoch habe ich noch nicht herausgefunden, wie genau ich einstelle, dass nur eingeloggt Nutzer auf die Seite können!
Ich habe diverse Themen durchsucht & verschiedene Lösungen probiert/getestet, jedoch nie wirklich den richtigen Lösungsweg gefunden. Deswegen dachte ich mir, ich poste mal meinen Code hier und hoffe das ihn jemand richtig editieren kann, sodass es endlich funktioniert.

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.
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.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
<?php
/*
##########################################################################
#                                                                        #
#           Version 4       /                        /   /               #
#          -----------__---/__---__------__----__---/---/-               #
#           | /| /  /___) /   ) (_ `   /   ) /___) /   /                 #
#          _|/_|/__(___ _(___/_(__)___/___/_(___ _/___/___               #
#                       Free Content / Management System                 #
#                                   /                                    #
#                                                                        #
#                                                                        #
#   Copyright 2005-2009 by webspell.org                                  #
#                                                                        #
#   visit webSPELL.org, webspell.info to get webSPELL for free           #
#   - Script runs under the GNU GENERAL PUBLIC LICENSE                   #
#   - It's NOT allowed to remove this copyright-tag                      #
#   -- http://www.fsf.org/licensing/licenses/gpl.html                    #
#                                                                        #
#   Code based on WebSPELL Clanpackage (Michael Gruber - webspell.at),   #
#   Far Development by Development Team - webspell.org                   #
#                                                                        #
#   visit webspell.org                                                   #
#                                                                        #
##########################################################################
*/

// important data include
include("_mysql.php");
include("_settings.php");
include("_functions.php");

$_language->read_module('index');
$index_language = $_language->module;
// end important data include
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="Clanpage using webSPELL 4 CMS" />
<meta name="author" content="webspell.org" />
<meta name="keywords" content="webspell, webspell4, clan, cms" />
<meta name="copyright" content="Copyright &copy; 2005 - 2009 by webspell.org" />
<meta name="generator" content="webSPELL" />

<!-- Head & Title include -->
<title><?php echo PAGETITLE; ?></title>
<link href="tmp/rss.xml" rel="alternate" type="application/rss+xml" title="<?php echo getinput($myclanname); ?> - RSS Feed" />
<!-- end Head & Title include -->

<!-- Footerpanel -->
<link href="_fp_stylesheet.css" rel="stylesheet" type="text/css" />
<script src="js/footerpanel.js" language="jscript" type="text/javascript"></script>
<!-- End Footerpanel -->

<!-- CSS INCLUDE -->
<link href="_stylesheet.css" rel="stylesheet" type="text/css" />
<link href="css/design-style.css" rel="stylesheet" type="text/css" />

<!-- JAVASCRIPT INCLUDE -->
<script src="js/bbcode.js" language="jscript" type="text/javascript"></script>
<!-- 
     #####################################
     #            FREE DESIGN BY                #
     #          XL-WEBSOLUTION.DE               #
     #####################################
-->
</head>

<body onload="toggleFooterpanel(true);">
<?php include("sc_footerpanel.php"); ?>
<div id="main_container">
<div id="header"></div>

<div id="navi_leiste">
<div id="navi">
<ul>
          <li class="navleft"><a href="#"></a></li>
        <li class="news"><a href="index.php?site=home"></a></li>
        <li class="teams"><a href="index.php?site=squads"></a></li>
        <li class="match"><a href="index.php?site=clanwars"></a></li>
          <li class="com"><a href="index.php?site=forum"></a></li>
        <li class="files"><a href="index.php?site=files"></a></li>
        <li class="part"><a href="index.php?site=partners"></a></li>
        <li class="spon"><a href="donate.php"></a></li>
        <li class="navright"><a href="#"></a></li>
      </ul>
</div>
</div>
<div id="content">
          <div id="left">
          
        <?PHP
          $submitMessage = $_GET['paypal'];
          if ($submitMessage == success)
          {
          echo '<div class="congratulations"><font color="#84d20c"><strong>Congratulations:</strong></font> You have been added to "Premium-Users", please wait for a map change in order for it to take effect.</div>';
          }else if($submitMessage == NULL){
          }else if($submitMessage == fail){
          echo '<div class="error"><font color="#d3430c"><strong>Error:</strong></font> You either cancled the paypal payment or there were error in the transaction. If it was the later please contact an admin.</div>';
          }
          ?>
          <center><h1><i><u><b>Premium</u></b></i></h1></center><br><br>
          <table width="894" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="603" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td background="style/titlebg.jpg" height="15">
                              <font style="font-family:Calibri" size="-1" color="#9a9a9a">&nbsp;Features (Deutsch/German)</font>               </td>
          </tr>
          <tr>
            <td><table width="50%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                               <p>&nbsp;Hier k&ouml;nnen Sie sich Premium f&uuml;r die Server kaufen und uns gleichzeitg &nbsp;unterst&uuml;tzen und wir k&ouml;nnen somit unseren Clan weiter ausbauen &nbsp;(Server/Website und so weiter..)! Au&szlig;erdem k&ouml;nnen Sie sich auf den &nbsp;Servern von uns mehr Features sichern und somit eine Menge Spa&szlig;, eine &nbsp;ungef&auml;hre Liste der Features finden Sie direkt unter diesem Text hier.</p>
               <p>&nbsp;</p>
               <p>&nbsp;Hier sind einige der Features:</p>
               <ul>
                - Wilkommensnachricht beim joinen<br />
                - Trails f&uuml;r Premium-Nutzer<br />
                - Geld: 2500$ jede Runde dazu<br />
                - &Auml;nderbarer Skin f&uuml;r Premium-Nutzer<br />
                - Premium Chat Tag<br />
                - Laser beim schie&szlig;en<br />
                - Keine Damage von eigenen HE-Granaten
           </ul>
            &nbsp;RAGEPLAY' beh&auml;lt sich das Recht vor jederzeit die Features auf den &nbsp;Servern zu &auml;ndern!<br>
            &nbsp;Es besteht kein Anspruch wegen Nicht-verf&uuml;gbarkeit der Server und die &nbsp;Premium-Mitgliedschaft sch&uuml;tzt auch keinesfalls vor einem Ban, Mute oder &nbsp;einem Kick!
              </tr>
<br>
                </table></td>
          </tr>
        </table></td>
        <td width="17">&nbsp;</td>
        <td width="50%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td background="style/titlebg.jpg" height="15">
                              <font style="font-family:Calibri" size="-1" color="#9a9a9a">&nbsp;Features (English)</font>               </td>
          </tr>
          <tr>
            <td>
                             <p>Here you can buy Premium for our Servers. It will support the development of our Servers/Website and more. It will help us grow up to a bigger Game-Community. Also you will get alot of fun with these Premium-Features on our Servers! A list of some of the Features on our Servers i right under this text.</p>
               <p>&nbsp;</p>
               <p>Here are some Features:</p>
               <ul>
                - Welcomemessage when you join<br />
                - Player-Trails<br />
                - 2500$ added to your money every round<br />
                - Changeable Player-Skin<br />
                - Premium Chat Tag<br />
                - Bullet-Lasers (shooting Lasers)<br />
                - No Damage from own Nates
           </ul>
            &nbsp;RAGEPLAY' has the rights to change the Features of Premium everytime!<br>
            &nbsp;There is no claim for non-availability of the Servers and also Premium- &nbsp;membership means not that you're protectet from Ban, Mute or Kick!

            </td>
          </tr>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  
  <tr>
    <td>&nbsp;</td>
  </tr>
  
</table>
        <form name="_xclick" action="https://www.paypal.com/us/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="amount" value="2.50">
<input type="hidden" name="business" value="paypal_email">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="item_name" value="PremiumMod Payment">
<input type="hidden" name="notify_url" value="addsteam.php">
<input type="hidden" name="return" value="index.php?paypal=success">
<input type="hidden" name="cancel_return" value="index.php?paypal=fail">
<input type="hidden" name="rm" value="1">
<center><h1>PayPal</h1><table>
    <tr>
        <td>
            SteamID
        </td>
        <td>
            <input size="30" name="item_number"/>
        </td>
    </tr>
    <tr>
        <td>
            Dein/Your Nickname
        </td>
        <td>
            <input size="30" name="item_number_playername"/>
        </td>
    </tr>
    <tr>
        <td>
           Zeit/Time
        </td>
        <td>
        <select size="1" name="quantity">
        <option value="1">1 Month (2,50&euro;)</option>
        <option value="3">3 Months (7,50&euro;)</option>
        <option value="6">6 Months (15&euro;)</option>
        <option value="12">1 Year (30&euro;)</option>
        </select>
        </td>
    </tr>
    <tr>
        <td>
           <br><input type="image" src="button" border="0" name="submit" alt="Weiter">
        </td>
    </tr>
</table></center>
</form><br>
<center>You don't have PayPal and want to buy via PaySafeCard? Click <a href="psc.php">HERE</a></center>
<center>Du hast kein PayPal und willst mit PaySafeCard zahlen? Dann klicke <a href="psc.php">HIER</a></center>
<br><br><br><br>
       </div>
       
  <div id="right">
               <div class="sidebar_bg">&nbsp;&nbsp;Hilfe (Deutsch/German):
                    <table><tr><td><ul>
                         - Bitte beachte, dass wenn die Monate wof&uuml;r bezahlt wurde abgelaufen sind, dass die SteamID automatisch entfernt wird und dein Premium abl&auml;uft!<br />
                         - Die Zahlungsm&ouml;glichkeiten sind nur PayPal und PaySafeCard!<br />
                         - Wenn du via PayPal zahlst wirst du direkt der Premiumliste hinzugef&uuml;gt!<br />
                 </ul></td></tr></table>
               </div>
            <div class="sidebar_bottom"></div>
              <div id="right">
               <div class="sidebar_bg">&nbsp;&nbsp;Help (English):
                    <table><tr><td><ul>
                         - If the months you paid for are over, your SteamID will be automatically deleted from the Premiumlist and you're not Premium anymore!<br />
                         - You can only pay via PayPal or PaySafeCard!<br />
                         - When you have bought Premium via PayPal you will be automatically added to the Premiumlist!<br />
                 </ul></td></tr></table>
               </div>
            <div class="sidebar_bottom"></div>
          </div>
     </div><br>
<div id="footer"><span style="padding:5px;">
  <?php include("footer.php"); ?>
</span></div>
</div>
</body>
</html>


Liebe Grüße
~TheGame980
 
15.04.2012, 20:38 - BlueaKaKev - Moderator - 1709 Posts
if($loggedin) {
code hier wenn eingeloggt
}
else {
Code wenn nicht eingeloggt
}
 
15.04.2012, 22:25 - TheGame980 - webSPELL newbie - 8 Posts
Hast zwar das selbe wie ichs oft gelesen habe geschrieben, jedoch habe ich es endlich gelöst^^
Kam nie klar mit <div> bei echo "" und habe dann einfach statt echo die include funktion gemacht und den ganzen text in eine "externe" Datei gepackt^^.

Trotzdem vielen Dank