Results 1 to 9 of 9
  1. #1
    FrogIsHam's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    The Dank Side of the Meme
    Posts
    841
    Reputation
    26
    Thanks
    104
    My Mood
    Happy

    [Help][Request][HTML][PHP][SMF][000WebHost] - Custom Page Coding Integration

    Hello forum members I need some help on some custom page coding integration I want to be able to have both html and php, but when I add my html with echo ' Html here '; it puts everything I did in the top corner I'm not sure if it's a CSS problem or my coding. I'm trying to add a whole bunch of PayPal donation buttons, also this is a custom page, but It's linked into index.php
    Attached Thumbnails Attached Thumbnails
    helppleasee.png  


  2. #2
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    I assume it's a css 'problem'. Basically you can't just 'echo' the info at the beginning of the web-page file and expect it to know where to go. Inside each <div ***> you will put the appropriate
    <?php
    echo 'myhtmlhere' . etc . etc ;
    ?>

    So, your web-page code basically looks like this?

    ...
    <div id="donations_section">
    <div id="DonationMineCraft">
    lotsoftextgoeshere
    </div>
    <div id="Donati********3d">
    lotsoftextgoeshere
    </div>
    </div>

    kind-of? Did you make it a php page (ie. opens with a <?php tag, or html ie <html>) ? If it's a html page w/ php inserted, just add..

    <div id="donations_section">
    <div id="DonationMineCraft">
    <?php
    echo'lotsoftextgoeshere'
    ?>
    </div>
    <div id="Donati********3d">
    <?php
    echo'lotsoftextgoeshere'
    ?>
    </div>
    </div>

    ^^ Of course if you're already in a php block don't put the extra <?php ?> 's.

    Or, I'm not sure what you mean exactly. If you upload the page's source (..take out any 'sensitive' parts as needed ofc) maybe to something like pastebin or even here using the

    [ code ]
    [ /code ] tags. (take out the extra spaces)

    I'll look at it.
    Last edited by abuckau907; 03-06-2013 at 09:58 PM.
    'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
    --
     

    My posts have some inaccuracies/are wrong/wrong keyword(s) used.
    They're (maybe) pretty close, and I hope they helped you, not created confusion. Take with grain of salt.

    -if you give rep, please leave a comment, else it means less.

  3. The Following User Says Thank You to abuckau907 For This Useful Post:

    FrogIsHam (03-08-2013)

  4. #3
    FrogIsHam's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    The Dank Side of the Meme
    Posts
    841
    Reputation
    26
    Thanks
    104
    My Mood
    Happy
    Donatemc.php
    Code:
    <?php
     
    if (!defined('SMF'))
    	die('Hack Attempt...');
    
    function DonatemcMain()
    {
    
    	global $context, $scripturl, $txt, $smcFunc;
    
    	loadTemplate('Donatemc');
    
    	$context['page_title'] = $txt['donatemc_PageTitle'];
    	$context['page_title_html_safe'] = $smcFunc['htmlspecialchars'](un_htmlspecialchars($context['page_title']));
    
    
    	$context['linktree'][] = array(
      		'url' => $scripturl. '?action=donatemc',
     		'name' => 'Donation (Minecraft)',
    	);
    	$context['donatemc_Head'] = 'Donation (Minecraft)';
    	$context['donatemc_Body'] = 'Hello World!';
    }
    echo '
    Paypal Button Code Here
    Paypal Button Code Here
    Paypal Button Code Here
    Paypal Button Code Here
    Paypal Button Code Here
    Paypal Button Code Here
    Paypal Button Code Here
    Paypal Button Code Here
    ';
    
    
    ?>
    Donatemc.template.php
    Code:
    <?php
    
    function template_main()
    {
    
    	global $context;
    
    	// Catbg header
    	echo '<div class="cat_bar">
       			<h3 class="catbg">', $context['donatemc_Head'], '</h3>
    	</div>';
    
    	// Windowbg2 Content
    	echo '<div class="windowbg2">
      			<span class="topslice"><span></span></span>
      		  		<div class="content">', $context['donatemc_Body'], '</div>
      			<span class="botslice"><span></span></span>
    	</div><br />';
    
    }
    
    ?>
    Last edited by FrogIsHam; 03-07-2013 at 02:04 PM. Reason: Fixing Code

  5. #4
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    What about index.php ...
    Last edited by abuckau907; 03-07-2013 at 08:03 PM. Reason: Not all the code
    'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
    --
     

    My posts have some inaccuracies/are wrong/wrong keyword(s) used.
    They're (maybe) pretty close, and I hope they helped you, not created confusion. Take with grain of salt.

    -if you give rep, please leave a comment, else it means less.

  6. The Following User Says Thank You to abuckau907 For This Useful Post:

    FrogIsHam (03-08-2013)

  7. #5
    FrogIsHam's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    The Dank Side of the Meme
    Posts
    841
    Reputation
    26
    Thanks
    104
    My Mood
    Happy
    These are all the pages I edited for my custom page.
    index.php...
    Code:
    	// Here's the monstrous $_REQUEST['action'] array - $_REQUEST['action'] => array($file, $function).
    	$actionArray = array(
    		// Start Custom Home Action
    		'home' => array('Home.php', 'HomeMain'),
    		// End Custom Home Action
    		// Start Custom Donation (Minecraft) Action
    		'donatemc' => array('Donatemc.php', 'DonatemcMain'),
    		// End Custom Donation (Minecraft) Action
    Index.english.php...
    Code:
    $txt['message_index'] = 'Message Index';
    $txt['news'] = 'News';
    $txt['forums'] = 'Forums';
    $txt['home'] = 'Home';
    $txt['donatemc'] = 'Donatemc';
    Modification.english.php...
    Code:
    // Start Custom Donation (Minecraft) Action
    $txt['donatemc'] = 'Donatemc';
    $txt['donatemc_PageTitle'] = 'Website Name Here - Donation (Minecraft)';
    // End Custom Donation (Minecraft) Action
    Who.english.php...
    Code:
    // Start Custom Donation (Minecraft) Action
    $txt['whoall_donatemc'] = 'Viewing <a href="' . $scripturl . '?action=donatemc">Index Title</a>.';
    // End Custom Donation (Minecraft) Action
    Subs.php...
    Code:
    			'donatemc' => array(
    				'title' => 'Server',
    				'show' => true,
    				'sub_buttons' => array(
    					'donatemc' => array(
    						'title' => 'Donate (Minecraft)',
    						'href' => $scripturl . '?action=donatemc',
    						'show' => true,
    					),
    					'votemc' => array(
    						'title' => 'Vote (Minecraft)',
    						'href' => $scripturl . '?action=votemc',
    						'show' => true,
    					),
    					'donaters' => array(
    						'title' => 'Donate (soon)',
    						'href' => $scripturl . '?action=soon',
    						'show' => true,
    					),
    					'voters' => array(
    						'title' => 'Vote (soon)',
    						'href' => $scripturl . '?action=soon',
    						'show' => true,
    					),
    				),
    			),
    Last edited by FrogIsHam; 03-07-2013 at 09:15 PM.

  8. #6
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    Is this copied from a public code base or did you write it all yourself?

    I don't do php very often, but I fail to see how all the code you posted == the picture in your original post (minus css of course) ?

    I was expecting something like..
    index.php
    Code:
    <html>
    ....
    <body>
    <div id="main_container">
    <div id="more_divs">
    ...
     <?php
       echo "<hr>This is from echo1. Copy?<hr>";
       // include("...") maybe?
      ?>
    </div>
    <div id="etc_etc">
    ...
     <?php
       echo "<hr>This is from echo2. Copy?<hr>";
       //include("..") maybe?
      ?>
    </div>
    ...
    </div> //main_container
    </body>
    </html>
    ^^Obviously not structured exactly like that.

    I'm not sure.
    Last edited by abuckau907; 03-07-2013 at 10:29 PM.
    'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
    --
     

    My posts have some inaccuracies/are wrong/wrong keyword(s) used.
    They're (maybe) pretty close, and I hope they helped you, not created confusion. Take with grain of salt.

    -if you give rep, please leave a comment, else it means less.

  9. The Following User Says Thank You to abuckau907 For This Useful Post:

    FrogIsHam (03-08-2013)

  10. #7
    Splak's Avatar
    Join Date
    Feb 2013
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    2
    My Mood
    Aggressive
    Looks like a template fail

    What about:
    Donatemc.php:
    Code:
    <?php
    
    function template_main()
    {
    
    	global $context;
    
    	// Catbg header
    	echo '<div class="cat_bar">
       			<h3 class="catbg">'.$context['donatemc_Head'].'</h3>
    	</div>';
    
    	// Windowbg2 Content
    	echo '<div class="windowbg2">
      			<span class="topslice"><span></span></span>
      		  		<div class="content"><ul><li>'.$context['donatemc_Body'].'</li><li>'.$context['donatemc_Button'].'</li></ul></div>
      			<span class="botslice"><span></span></span>
    	</div><br />';
    
    }
    
    ?>
    Donatemc.template.php:
    Code:
    <?php
     
    if (!defined('SMF'))
    	die('Hack Attempt...');
    
    function DonatemcMain()
    {
    
    	global $context, $scripturl, $txt, $smcFunc;
    
    	loadTemplate('Donatemc');
    
    	$context['page_title'] = $txt['donatemc_PageTitle'];
    	$context['page_title_html_safe'] = $smcFunc['htmlspecialchars'](un_htmlspecialchars($context['page_title']));
    
    
    	$context['linktree'][] = array(
      		'url' => $scripturl. '?action=donatemc',
     		'name' => 'Donation (Minecraft)',
    	);
    	$context['donatemc_Head'] = 'Donation (Minecraft)';
    	$context['donatemc_Body'] = 'Hello World!';
      $context['donatemc_Button'] = 'PAYPAL BUTTON CODE';
    }
    
    ?>
    CSS:
    Code:
    .content ul {
    width: 100%;
    }
    
    .content ul li {
    width: 50%;
    display: inline-block;
    float: left;
    }

  11. The Following User Says Thank You to Splak For This Useful Post:

    FrogIsHam (03-08-2013)

  12. #8
    FrogIsHam's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    The Dank Side of the Meme
    Posts
    841
    Reputation
    26
    Thanks
    104
    My Mood
    Happy
    Thank you @Splak, and thank you @abuckau907
    I noticed when I put in the CSS code it messed up the layout and moved everything around so I took the CSS code out and it looks perfect just one thing how do I get rid of the bullet next to everything?
    Last edited by FrogIsHam; 03-08-2013 at 10:01 AM.

  13. #9
    Splak's Avatar
    Join Date
    Feb 2013
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    2
    My Mood
    Aggressive
    Oh well I'm sorry.
    Than only add this to your css code:
    Code:
    .content ul li {
    list-style-type: none;
    }

  14. The Following User Says Thank You to Splak For This Useful Post:

    FrogIsHam (03-10-2013)

Similar Threads

  1. [Help] - Forum Icon Legend - [SMF Theme] [000WebHost]
    By FrogIsHam in forum Web Languages
    Replies: 0
    Last Post: 02-27-2013, 09:03 AM
  2. [Help Request] [Help Request] How to make No Recoil hack in Visual Studio?
    By Tstovall in forum CrossFire Help
    Replies: 5
    Last Post: 07-20-2011, 02:55 AM
  3. [Help Request] HElp request ?
    By wakosam in forum CrossFire Help
    Replies: 2
    Last Post: 07-17-2011, 06:35 PM
  4. [Help Request] Easy Help Request.
    By KrustyKokehead in forum Vindictus Help
    Replies: 6
    Last Post: 06-01-2011, 05:58 PM
  5. [Request] Phishing Pages Tut or Help [Request]
    By condor01 in forum Hack Requests
    Replies: 3
    Last Post: 08-03-2007, 02:29 PM