The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

How to make a banner code generator.

Page 1 of 2 1, 2  Next

View previous topic View next topic Go down

Solved How to make a banner code generator.

Post by smurfavr on June 30th 2014, 5:04 pm

How to make this code work on my site.This is the code which banner generator.

Code:
<div class="box">
<div class='boxhead'>Банер Генератор</div>     
<center>
<?php
$random_number = rand(1, 5);
$random_banner[1] = 'Колко е 18-9';
$random_banner[2] = 'Колко е 5+4';
$random_banner[3] = 'Колко е 8+1';
$random_banner[4] = 'Колко е 2+7';
$random_banner[5] = 'Колко е 15-6';

function validateIpAddress($ip_addr) {
     
if(preg_match("/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\:[0-9]{1,5}/",$ip_addr))
{
return true; 
} else { 
return false;
}
}
?>
<fieldset><legend>Статистиката съдържа само играта:Counter-Strike 1.6</legend>
<form method="post" action="">
<label><strong>IP Адрес:</strong></label>
<br />
<input name="ip" type="text" size="30"/>
<br />
<label><strong><?php echo $random_banner[$random_number]; ?></strong></label>
<br />
<input name="code" type="text" size="30"/>
<br /><br />
<input type="submit" name="napravi" class="button1" value="Създай"/>
</form>
</fieldset>     
<?php
if(isset($_POST['napravi']))
{
$ip = addslashes(trim($_POST['ip']));
$code =  trim($_POST['code']);
           
if($ip == NULL || $code == NULL)
{
echo "<br /><div class='error message'>Моля, попълнете всички полета!</div><br />";
} else {
if(validateIpAddress($ip))
{
if($code != 9) {
echo "<br /><div class='error message'>Кодът е грешен!</div><br />
";
} else {
$check = mysql_query("SELECT * FROM server_gen WHERE ip = '$ip'");
if($num = mysql_num_rows($check)){
echo "<br /><div class='error message'>Този IP адрес вече е бил използван.</div><br />";
echo '
<fieldset><legend>Демо на картинката</legend>
<img src="../small/small.php?ip='.$ip.'">
</fieldset>
<fieldset><legend>Кодове за вграждане</legend>
<label for="codebb">BBCode (за форуми):</label>
<input align="center" value="[url=http://www.ultra-zonecs.info][img]http://www.ultra-zonecs.info/small/small.php?ip='.$ip.'[/img][/url]" type="text" size="99">
<label for="codebb">HTML (за сайтове):</label>
<input align="center" value="<img src=http://www.ultra-zonecs.info/small/small.php?ip='.$ip.'>" type="text" size="99">
</fieldset>';
} else {
$sql = mysql_query("INSERT INTO server_gen (ip) VALUES ('$ip')");
echo '
<fieldset>
<legend>Демо на картинката</legend>
<img src="../small/small.php?ip='.$ip.'">
</fieldset>
<fieldset><legend>Кодове за вграждане</legend>
<label for="codebb">BBCode (за форуми):</label>
<input align="center" value="[url=http://www.ultra-zonecs.info][img]http://www.ultra-zonecs.info/small/small.php?ip='.$ip.'[/img][/url]" type="text" size="99">
<label for="codebb">HTML (за сайтове):</label>
<input align="center" value="<img src=http://www.ultra-zonecs.info/small/small.php?ip='.$ip.'>" type="text" size="99">
</fieldset><br /><br /><br />';
}
}
} else {
echo "<br /><div class='error message'>Моля, въведете реален IP адрес и порт.</div><br />";
}
}
}
?></center>
</div>

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by SLGray on June 30th 2014, 7:43 pm

You can add the code anywhere that HTML is allowed.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35660
Reputation : 2375
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by smurfavr on June 30th 2014, 8:01 pm

How to add where?

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by SLGray on June 30th 2014, 8:20 pm

Where do you want it on your forum?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35660
Reputation : 2375
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by smurfavr on June 30th 2014, 8:27 pm

I want to add a top menu on the site.

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by SLGray on June 30th 2014, 8:31 pm

Do you mean that you want it on a HTML page and have a link to it in the menu?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35660
Reputation : 2375
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by smurfavr on June 30th 2014, 8:46 pm

As is well so do it.

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by smurfavr on July 2nd 2014, 5:02 pm

up

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by Ange Tuteur on July 2nd 2014, 5:33 pm


Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: How to make a banner code generator.

Post by smurfavr on July 2nd 2014, 8:39 pm

It's not what I need.
I need something like this.
http://www.bulplay.net/banner-generator.html




I think this is the code, but if it works on my site and where to put it.
Code:
</div>
<?php } ?></div>
<div class="left">
<div class="bighead"><?php echo $page; ?></div>
<div class="bigtxt">
<center><?php
$random_number = rand(1, 5);
$random_banner[1] = 'Колко е 18-9';
$random_banner[2] = 'Колко е 5+4';
$random_banner[3] = 'Колко е 8+1';
$random_banner[4] = 'Колко е 2+7';
$random_banner[5] = 'Колко е 15-6';

 function validateIpAddress($ip_addr) {
 
  if(preg_match("/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\:[0-9]{1,5}/",$ip_addr))
  {
  return true;
  }
  else {
  return false;
 
  }
 }
?>
 <fieldset><legend>Статистиката съдържа само играта:Counter-Strike 1.6</legend><form action="" method="post"><label for="input-two" class="float"><strong>IP Адрес:</strong></label><br />
  <input class="inp-text" name="ip"  id="input-two" type="text" size="30" />
  <br /><label for="input-two" class="float"><strong><?PHP echo $random_banner[$random_number]; ?></strong></label><br />
  <input class="inp-text" name="code"  id="input-two" type="text" size="30" />
  </fieldset>
  <p><input class="buttona" type="submit" alt="SUBMIT" name="napravi" value="Създай" /></p>
  <br/>
 
  <?php
  if(isset($_POST['napravi']))
  {
    $ip = addslashes(trim($_POST['ip']));
    $code =  trim($_POST['code']);
   
    if($ip == NULL || $code == NULL)
    {
    echo "<fieldset>
    <legend>Грешка</legend>Моля, попълнете всички полета!</fieldset>";
    }else{
      if(validateIpAddress($ip))
      {
        if($code != 9) {
        echo "<fieldset>
        <legend>Грешка</legend>Кодът е грешен!</fieldset>
        ";
        }else{
      $check = mysql_query("SELECT * FROM server_gen WHERE ip = '$ip'");
        if($num = mysql_num_rows($check)){
          echo "<fieldset>
          <legend>Грешка
          </legend>Този IP адрес вече е бил използван.</fieldset><br /><br />
          ";
          echo '<fieldset>
      <legend>Демо на картинката
      </legend><img src="stats.php?ip='.$ip.'"></fieldset>
      <h3><fieldset>
      <legend>Кодове за вграждане</legend><div class="code_box"><label for="codebb">BBCode (за форуми):</label> <input id="codebb" value="[url=http://justplay-bg.info][IMG]stats.php?ip='.$ip.'[/IMG][/url]" onclick="javascript:this.focus();this.select();" readonly="false" class="text_input long" type="text"></div>
              <div class="code_box"><label for="codebb">HTML (за сайтове):</label> <input id="codebb" value="<img src=stats.php?ip='.$ip.'>" onclick="javascript:this.focus();this.select();" readonly="false" class="text_input long" type="text"></div>
             
              </h3>
              </fieldset>
              <br /><br /><div style="border-bottom: 1px dashed #ccc; width: auto;padding-bottom: 5px;padding-top: 5px;"></div><br /><br />
              <fieldset>
      <legend>Демо на картинката
      </legend><img src="small-stats.php?ip='.$ip.'"></fieldset>
      <h3><fieldset>
      <legend>Кодове за вграждане</legend><div class="code_box"><label for="codebb">BBCode (за форуми):</label> <input id="codebb..

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by Ange Tuteur on July 2nd 2014, 9:10 pm

In the templates, but I don't think php works in the templates. I never tried.

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: How to make a banner code generator.

Post by smurfavr on July 2nd 2014, 9:29 pm

I do not know. Can anyone tell is it possible to do what I want.

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by Ange Tuteur on July 2nd 2014, 9:31 pm

With javascript you can choose a random banner to display, like in the link I provided. However, I don't think you wanted to change the main banner.

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: How to make a banner code generator.

Post by smurfavr on July 2nd 2014, 10:05 pm

This code is a user, to make banners for servers by entering their IP.

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by erchima on July 6th 2014, 12:38 am

are u using php code?
if yes, you cn making file php and upload to your hosting, and call the php address to your forum

erchima
Forumember

Female Posts : 629
Reputation : 15
Language : INDONESIAN | Lua Script | Visual Basic | and Coding
Location : Under your bed xD

http://erchimacute.forumid.net

Back to top Go down

Solved Re: How to make a banner code generator.

Post by smurfavr on July 10th 2014, 1:49 am

It's not what you say.

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by smurfavr on July 15th 2014, 2:55 am

up

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by SLGray on July 15th 2014, 3:05 am

What exactly does not work?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35660
Reputation : 2375
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by smurfavr on July 15th 2014, 3:11 am

I have to put code.

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by SLGray on July 15th 2014, 3:16 am

Create a HTML page with the code. Then create a customized navigation button for that page.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35660
Reputation : 2375
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by smurfavr on July 15th 2014, 3:28 am

did HTML but it does not work.


smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by SLGray on July 15th 2014, 3:29 am

Could you please post the link to where you got the code?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35660
Reputation : 2375
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by smurfavr on July 15th 2014, 3:34 am

I have no link. Code is only HTML & JAVASCRIPT

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by SLGray on July 15th 2014, 3:39 am

Where did you get it from?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35660
Reputation : 2375
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by smurfavr on July 15th 2014, 3:47 am

The code I got from the forum administrator where I saw it.

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by SLGray on July 15th 2014, 3:47 am

Have you tried asking fro help from him/her?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35660
Reputation : 2375
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by smurfavr on July 15th 2014, 4:08 am

His website is another company and can not help me.


smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by SLGray on July 15th 2014, 4:21 am

Was this code posted on the site? If yes, please link me to it.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35660
Reputation : 2375
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by smurfavr on July 15th 2014, 4:40 am

His forum is this company.
https://www.phpbb.com/

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by SLGray on July 15th 2014, 4:42 am

Ok. So this code is from the official phpBB community?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35660
Reputation : 2375
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Page 1 of 2 1, 2  Next

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum