Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Modules
Author Message
kenno
Worker
Worker



Joined: Jul 26, 2009
Posts: 117
Location: Scunthorpe, UK

PostPosted: Mon Jun 27, 2011 2:09 pm Reply with quote

Sorry people, this will be a very easy question to most.

I can`t seem to add a simple image inside a custom module that I have created.

It is basically just a paypal button code which I need to restrict to only be accessed by a certain group.
All I want to to is add an image of the product above the code and then another small "return to shop" image below this.

Can anyone point me in the right direction

Code:
if ( !defined('MODULE_FILE') ) {

   die ('You can\'t access this file directly...');
}

require_once('mainfile.php');
$module_name = basename(dirname(__FILE__));

// BEGIN: Added in v2.40.00 - Mantis Issue 0001043
$index = 1;   // 0 : do not show right blocks - 1:show right blocks
if (!defined('INDEX_FILE')) define('INDEX_FILE', FALSE); // Set to FALSE to hide right blocks
if (defined('INDEX_FILE') AND INDEX_FILE===true) {
// auto set right blocks for pre patch 3.1 compatibility
   $index = 1;
}
// END: Added in v2.40.00 - Mantis Issue 0001043

include_once('header.php');

   echo '<div align="center">'."\n"
      .'<p><font class="content"><b>*Shop* Mk1 Golf Owners Club Hoodies (Member)</b></font></p>'."\n"
      .'<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="LU54BHQZCSU5C">
<table>
<tr><td><input type="hidden" name="on0" value="Colours">Colours</td></tr><tr><td><select name="os0">
   <option value="Blue">Blue £22.50</option>
   <option value="Red">Red £22.50</option>
   <option value="Black">Black £22.50</option>
</select> </td></tr>
<tr><td><input type="hidden" name="on1" value="Sizes">Sizes</td></tr><tr><td><select name="os1">
   <option value="Small">Small </option>
   <option value="Medium">Medium </option>
   <option value="Large">Large </option>
   <option value="X-Large">X-Large </option>
</select> </td></tr>
</table>
<input type="hidden" name="currency_code" value="GBP">
<input type="image" src="https://www.paypalobjects.com/en_GB/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>'."\n"
      .'</div>'."\n";



CloseTable();
include_once('footer.php');
die();

?>
 
View user's profile Send private message
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Mon Jun 27, 2011 3:19 pm Reply with quote

Add the images you want to the code, and then I will look it over. It should be strait forward so I am not really sure what you are looking for. Is it a positioning thing? Does the image just not show up?

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
killing-hours
RavenNuke(tm) Development Team



Joined: Oct 01, 2010
Posts: 438
Location: Houston, Tx

PostPosted: Mon Jun 27, 2011 4:13 pm Reply with quote

Is your image hosted locally? (I.e. the same server as RN?)

if so...

Code:
your code etc....


<img src="modules/your_image_folder/image.jpg" />

_________________
Money is the measurement of time - Me
"You can all go to hell…I’m going to Texas" -Davy Crockett 
View user's profile Send private message
kenno







PostPosted: Mon Jun 27, 2011 5:56 pm Reply with quote

Sorry I should of said, yes the image is hosted locally on the server and have tried that option of adding that code but the module just goes to a while screen so i have done something wrong in my attempts.

Where should I include code for the images, for one to show above the paypal button and one for below this.

Thanks for your help

Mark
 
Palbin







PostPosted: Mon Jun 27, 2011 7:16 pm Reply with quote

Code:


   echo '<div align="center">'."\n"
      .'<img alt="" src="PATH TO MY IMAGE/IMAGE.gif">'
      .'<p><font class="content"><b>*Shop* Mk1 Golf Owners Club Hoodies (Member)</b></font></p>'."\n"
      .'<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="LU54BHQZCSU5C">
<table>
<tr><td><input type="hidden" name="on0" value="Colours">Colours</td></tr><tr><td><select name="os0">
   <option value="Blue">Blue £22.50</option>
   <option value="Red">Red £22.50</option>
   <option value="Black">Black £22.50</option>
</select> </td></tr>
<tr><td><input type="hidden" name="on1" value="Sizes">Sizes</td></tr><tr><td><select name="os1">
   <option value="Small">Small </option>
   <option value="Medium">Medium </option>
   <option value="Large">Large </option>
   <option value="X-Large">X-Large </option>
</select> </td></tr>
</table>
<input type="hidden" name="currency_code" value="GBP">
<input type="image" src="https://www.paypalobjects.com/en_GB/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>'."\n"
   .'<img alt="" src="PATH TO MY IMAGE/IMAGE.gif">'
   .'</div>'."\n";
 
nuken
RavenNuke(tm) Development Team



Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Mon Jun 27, 2011 7:17 pm Reply with quote

Two problems I see are that you have not called OpenTable(); and you need to remove the die(); at the bottom.

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Send e-mail Visit poster's website
Palbin







PostPosted: Mon Jun 27, 2011 8:28 pm Reply with quote

nuken, good catch on the OpenTable. The die() should not matter, but I would remove it.
 
killing-hours







PostPosted: Tue Jun 28, 2011 7:24 am Reply with quote

Palbin-

Is this compliant??

Code:
'<img alt="" src="PATH TO MY IMAGE/IMAGE.gif">' 


I thought that it had to have a trailing " / " somewhere. (I.e. /> - short tag, or </img>)

Edit***

Html compliant = No end tag

XHTML compliant = Closed tag

http://www.w3schools.com/tags/tag_img.asp


@kenno... This is not a deal breaker/maker... but just a tip, it helps me more debugging when I echo particular things out rather than run everything under one echo. It might make it easier for you to find problems with code or organize it better if you echo out individual elements so that you can comment them out one at a time and see what works and doesn't work. Just a thought.


Your code re-written: (Note*** Palbin has mentioned it elsewhere... but you don't need to require the mainfile... modules.php already does this for you IF you're passing this modules through the modules file)

Code:
<?php


if ( !defined('MODULE_FILE') ) {die ('You can\'t access this file directly...');}

require_once('mainfile.php');
$module_name = basename(dirname(__FILE__));

// BEGIN: Added in v2.40.00 - Mantis Issue 0001043
$index = 1;   // 0 : do not show right blocks - 1:show right blocks
if (!defined('INDEX_FILE')) define('INDEX_FILE', FALSE); // Set to FALSE to hide right blocks
if (defined('INDEX_FILE') AND INDEX_FILE===true) {
// auto set right blocks for pre patch 3.1 compatibility
   $index = 1;
}
// END: Added in v2.40.00 - Mantis Issue 0001043
include_once('header.php');
OpenTable();
echo '<div align="center">';
// Your image
echo '<img src="YOUR_IMAGE_PATH" alt="" />';
// Why use font just to give it a class when the P could carry the class for you???
echo '<p><font class="content"><b>*Shop* Mk1 Golf Owners Club Hoodies (Member)</b></font></p>';
// Begin Form
echo '<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
// Hidden inputs
echo '<input type="hidden" name="cmd" value="_s-xclick">';
echo '<input type="hidden" name="hosted_button_id" value="LU54BHQZCSU5C">';
// Begin table
echo '<table>';
echo '<tr><td><input type="hidden" name="on0" value="Colours">Colours</td></tr>';
// Begin Select
echo '<tr><td><select name="os0">';
echo '<option value="Blue">Blue £22.50</option>';
echo '<option value="Red">Red £22.50</option>';
echo '<option value="Black">Black £22.50</option>';
echo '</select> </td></tr>';
echo '<tr><td><input type="hidden" name="on1" value="Sizes">Sizes</td></tr>';
// Begin Select
echo '<tr><td><select name="os1">';
echo '<option value="Small">Small </option>';
echo '<option value="Medium">Medium </option>';
echo '<option value="Large">Large </option>';
echo '<option value="X-Large">X-Large </option>';
echo '</select> </td></tr>';
// End table
echo '</table>';
// Hidden input
echo '<input type="hidden" name="currency_code" value="GBP">';
// Submit button
echo '<input type="image" src="https://www.paypalobjects.com/en_GB/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">';
echo '<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">';
// Close Form
echo '</form>';
// Your image
echo '<img src="YOUR_IMAGE_PATH" alt="" />';
echo '</div>';

CloseTable();
include_once('footer.php');

?>
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©