Need PHP Post Generator Script

Status
Not open for further replies.

RiteshH

Banned
Banned
143
2010
0
0
Hello guys,

I know this is a very common thing I am asking for but I need a post-generator PHP based to save my time.

I guess the creator of this is Hoxxy or someone similar to that name.

Supports downloads icons (I can place mine URL)

Thanks in advance.

--- RiteshH
 
22 comments
Um.

Provide me with an example BBCode post that you want to generate and I'll make you a simple one.

There you go:

PHP:
[img]Cover Image/Poster URL will be filled here[/img]

[IMG]Plot Button/Icon url here[/IMG]
[quote]Plot description...[/quote]

[IMG]NFO Button/Icon url here[/IMG]
[code]NFO goes here...[/code]

[IMG]Screen shots  Button/Icon url here[/IMG]
[img]Screenshot URL goes here....[/img]
[img]Screenshot URL goes here....[/img]
[img]Screenshot URL goes here....[/img]

[IMG]Download   Button/Icon url here[/IMG]
[img]FS   Button/Icon url here[/img]
[code]Download links of FS goes here...[/code]

[img]RS  Button/Icon url here[/img]
[code]Download links of RS goes here...[/code]

[quote]Addition information which I wanna put in...[/quote]

It will be awesome if you can provide me the source script, I can modify myself. thanks in advance mate. :D
 
lol c'mon it's a simple thingy xD

First 10pages of any php book(except the index and preview ones!) can give you the info on how this is done xD :P
 
Done! Let me know if this is to your liking. Very simple, 10 minutes of code.

Code:
http://www.mediafire.com/?9n934484ujybzpe
 
Done! Let me know if this is to your liking. Very simple, 10 minutes of code.

Code:
http://www.mediafire.com/?yxu362ndpkgb6u1
Thanks mate. will get back. :D

EDIT:

untitlsws.png


Some problem with it?

Plus I want to input the URL of the Icons/Button in the files itself and will be hidden, Users don't have to input for buttons.

Thanks in advance.
 
k, just give me the button urls and i'll hardcode those in. or if you like, i can make a config.php you edit easily so you can change your button urls.
 
k, just give me the button urls and i'll hardcode those in. or if you like, i can make a config.php you edit easily so you can change your button urls.
Yeah1 Config.php will be better. :D

Also one more thing mate that if I am posting only one url of the screenshout, why is it showing the other 2 img tags as well?
 
OK, so screenshots should now not show IMG tags if not filled in.
and you need to fill in config.php before you run the script.

Code:
http://www.mediafire.com/?erifzo6u5o6i17l
 
a while back i make something for Code-Projects, it supports post icons you can change that tinypic links or add simple text.. here is the code:

PHP:
<!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">

<head>
<title> Post Generator for C-P</title>
</head>

<body>
<div style="margin-left:200px;">
<form method="post" action="">
Cover: <input type="text" name="cover"><br />
Information:<br /><textarea name="information" rows="5" cols="40"></textarea><br />
IMDB: <input type="text" name="imdb"><br />
Screenshot(s):<br /><textarea name="screenshots" rows="5" cols="40"></textarea><br />
Download Links:<br /><textarea name="links" rows="5" cols="40"></textarea><br />
Password: <input type="text" name="password"><br />
<input type="submit" value="Generate Post">
</form>

<?php
if($_POST){

	$cover = $_POST['cover'];
	$screenshots = $_POST['screenshots'];
	$information = $_POST['information'];
	$imdb = $_POST['imdb'];
	$links = $_POST['links'];
	$password = $_POST['password'];
	if(empty($information) || empty($links)){
		echo 'Please fill in all required fields';
	} else {
		$post = '';
		if(!empty($cover)) $post .= '[IMG]'.$cover.'[/IMG]'."\n\n\n";
		$post .= '[img]http://i49.tinypic.com/25yuj3p.png[/img]'."\n";
		$post .= '[QUOTE]'.$information.'[/QUOTE]'."\n\n\n";
		if(!empty($imdb)){
		$post .= '[img]http://i46.tinypic.com/211udk9.png[/img]'."\n";
		$post .= '[CODE]'.$imdb.'[/CODE]'."\n\n\n";
		}		
		if(!empty($screenshots)){
			$screenshots = explode("\r\n", $screenshots);
			$post .= '[img]http://i45.tinypic.com/7296pl.png[/img]'."\n\n";
			foreach ($screenshots as $screenshot){
				$post .= '[IMG]'.$screenshot.'[/IMG]'."\n";
			}
			$post .= "\n\n";
		}
		$post .= '[img]http://i45.tinypic.com/2uf82m8.png[/img]'."\n";
		$post .= '[CODE]'.$links.'[/CODE]';
		if(!empty($password)){
			$post .= "\n\n".'[b]PASSWORD:[/b]'."\n";
			$post .= '[CODE]'.$password.'[/CODE]';
		}
		echo '<textarea rows="8" cols="40">'.$post.'</textarea>';
	}
}
?>
</div>
</body>
</html>
 
Post generator
Code:
<!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" lang="en" xml:lang="en"> 
<head>
<LINK REL="SHORTCUT ICON" HREF="favicon.ico">
<meta http-equiv="content-language" content="en-gb" />
<meta name="Author" content="" /> 
<meta name="Description" content="forum post generater" /> 
<meta name="Keywords" content=",forum,post,generater,mod" /> 
<title>MegaSerbia Post Generator</title> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<script type="text/javascript" src="./doStuff.js">
</script> 
<style type="text/css"> 
/*<![CDATA[*/
 body.c3 {font-family:verdana;}
 div.c2 {text-align: center}
 span.c1 {font-size: 70%;}
/*]]>*/
</style> 
</head> 
<body class="c3"> 
<div class="c2">
<table border="0" width="70%" align="center" bgcolor="gainsboro"> 
<tr>
<td> 
<img src="Your Banner.png" alt="Forum" />
</td> 
</tr> 
<tr> 
<td> 
<h2>Post Generator</h2> 
</td> 
</tr> 
<tr> 
<td><strong>Instructions:</strong><br /> 
<strong>1.</strong>Enter your information in the boxes<strong><br /> 
2.</strong>Click the generate button <strong><br /> 
3.</strong>Copy text and post in new thread</td> 
</tr> 
<tr> 
<td><br /> 
<form name="frm" action="hxy.html#" id="frm"> 
<div><strong>Post Title:</strong> 
<div><input id="title" value="" maxlength="60" size="60" type="text" /></div> 
<br /> 
<div><strong>Main Image:</strong></div> 
<div><input id="boxart" value="" maxlength="200" size="60" type="text" /></div>
 <br /> 
<div><strong>IMDB url:</strong></div> 
<div><input id="imdb" value="" maxlength="100" size="60" type="text" /></div> 
<br /> 
<div><strong>Information:</strong></div> 
<div> 
<textarea id="info" cols="46" rows="7"> 
</textarea></div> 
<br /> <div><strong>Track List:</strong></div> <div> <textarea id="Track List" cols="46" rows="7"> </textarea></div> <br /> 
<div><strong>Screenshots:</strong></div> 
<div><input id="sshot1" maxlength="200" size="60" type="text" /></div> 
<div><input id="sshot2" maxlength="200" size="60" type="text" /></div> 
<div><input id="sshot3" maxlength="200" size="60" type="text" /></div> 
<div><input id="sshot4" maxlength="200" size="60" type="text" /></div>
<div><input id="sshot5" maxlength="200" size="60" type="text" /></div>
<br /> 
<div><strong>Download Links:</strong></div> 
<div> 
<textarea id="downlinks" cols="46" rows="7"> 
</textarea></div> 
<br /> 
<div><strong>Password:</strong></div> 
<div><input id="pass" value="" maxlength="100" size="60" type="text" /></div> 
<br /> 
<br /> 
<div><INPUT type="reset" value="Reset">&nbsp;&nbsp;
     <INPUT type="button" class="btnmain" onClick="doStuff()" value="Generate My Post!"></div> 
<br /> 
<br /> 
<div> 
<textarea name="gen" cols="63" rows="10" id="gen" onClick="javascript:frm.gen.focus();frm.gen.select();">Generated content</textarea></div> 
</div> 
</form> 
</td> 
</tr> 
<tr> 
<td>Thank you for sharing with the community!</td> 
</tr> 
<tr> 
<td><a href="#" title="" target="_blank"></a></td> 
</tr> 
</table> 
</div> 
</body> 
</html>
save it as .php

PHP:
            function doStuff()
            {
            var txt = "";
            document.getElementById("gen").value = "";

            if (document.getElementById("title").value != ""){
            txt += "[textarea][center][b][color=#FF0000][size=150]";
            txt += document.getElementById("title").value; //Add title
            txt += "[/size][/color][/b][/center][/textarea]";
            document.getElementById("gen").value += txt;
            }

            if (document.getElementById("boxart").value != ""){
            txt = "\n\n[img\]";
            txt += document.getElementById("boxart").value; //Add boxart
            txt += "[/img]";
            document.getElementById("gen").value += txt;
            }

            
                        if (document.getElementById("imdb").value != ""){
            txt = "";
            txt += "\n\n[img]http://i34.tinypic.com/5bqzgk.jpg[/img]";
            txt += "\n[code]";
            txt += document.getElementById("imdb").value;
            txt += "[/code]";
            document.getElementById("gen").value += txt;
            }

            
            if (document.getElementById("info").value != ""){
            txt = "";
            txt += "\n\n[img]http://i42.tinypic.com/2pte9nm.jpg[/img]\n";
            txt += "\n[code]";
            txt += document.getElementById("info").value;
            txt += "[/code]";
            document.getElementById("gen").value += txt;
            }
            
            if (document.getElementById("Track List").value != ""){
            txt = "";
            txt += "\n\n[img]http://i29.tinypic.com/2yywneg.png[/img]\n";
            txt += "\n[code]";
            txt += document.getElementById("info").value;
            txt += "[/code]";
            document.getElementById("gen").value += txt;
            }

            if (document.getElementById("sshot1").value != ""){
            txt = "";
            txt += "\n\n[img]http://i39.tinypic.com/2441ba1.jpg[/img]";
            txt += "\n[img]";
            txt += document.getElementById("sshot1").value;
            txt += "[/img]";
            document.getElementById("gen").value += txt;
            }


            if (document.getElementById("sshot2").value != ""){
            txt = "";
            txt += "\n[img]";
            txt += document.getElementById("sshot2").value;
            txt += "[/img]";
            document.getElementById("gen").value += txt;
            }



            if (document.getElementById("sshot3").value != ""){
            txt = "";
            txt += "\n[img]";
            txt += document.getElementById("sshot3").value;
            txt += "[/img]";
            document.getElementById("gen").value += txt;
            }



            if (document.getElementById("sshot4").value != ""){
            txt = "";
            txt += "\n[img]";
            txt += document.getElementById("sshot4").value;
            txt += "[/img]";
            document.getElementById("gen").value += txt;
            }


            if (document.getElementById("sshot5").value != ""){
            txt = "";
            txt += "\n[img]";
            txt += document.getElementById("sshot5").value;
            txt += "[/img]";
            document.getElementById("gen").value += txt;
            }

            document.getElementById("gen").value += "\n";


            if (document.getElementById("downlinks").value != ""){
            txt = "";
            txt += "\n\n[img]http://i40.tinypic.com/2mpzup5.jpg[/img]";
            txt += "\n[code]";
            txt += document.getElementById("downlinks").value;
            txt += "[/code]";
            document.getElementById("gen").value += txt;
            }

            if (document.getElementById("pass").value != ""){
            txt = "";
            txt += "\n\n[img]http://i43.tinypic.com/2evbxua.jpg[/img]";
            txt += "\n[code]";
            txt += document.getElementById("pass").value;
            txt += "[/code]";
            document.getElementById("gen").value += txt;
            }

            txt = "";
            txt += "\n\n[size=100]Post Generated By [color=#FF8000][url=]title[/url][/color] [/size]\n";

        

            document.getElementById("gen").value += txt;
            }
Save it as doStuff.js ;)
 
Status
Not open for further replies.
Back
Top