DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • August 26, 2016, 09:36:05 PM
Home Forums News Links Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
IRC Channels
Search

Pages: [1]   Go Down
  Print  
Author Topic: Images  (Read 3102 times)
0 Members and 1 Guest are viewing this topic.
Ozlander
Guest
« on: April 18, 2005, 05:42:47 PM »

HI..

I'm very new to PHP and LotGD, I was wondering how do I add a image to a page, ECT: When I goto the bank I wish to display an image of the bank.

Also, how do I add images to the weapon and armor so it displays in the shop and aswell in the players info.

I hope it can be done.

Later
Ozlander
http://www.lotgd.stuartmitchell.net
Logged
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #1 on: April 18, 2005, 05:53:08 PM »

Depending on the location of the image, hook to header bank.
Code:
case "header-bank":
rawoutput("<center>");
rawoutput("<img src='./images/bank.jpg'>");
rawoutput("</center><br>");
break;
If it is in the root images folder of the lotgd folder.

For the weapons, try using the objprefs for weapons/armor, and go about it that way. But, it might be more trouble than it is worth.
« Last Edit: April 18, 2005, 05:54:52 PM by Sichae » Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Freeze
Guest
« Reply #2 on: April 18, 2005, 07:02:24 PM »

I was just testing it out, and copy/pasting that code didn't work, unless there was somewhere specific it needed to be placed.
Logged
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #3 on: April 18, 2005, 07:09:32 PM »

Most likely, it wouldn't work. Since the headers almost never work for putting in centralized code.

So, you might have to just create your own modulehook in there.

You could try footer-bank, but that would display under the text of the bank. Yes, that actual code does work, just not the hook.

http://sichae.uk.to/bank.jpg

Of course, that was me manually placing the code into the core bank.php
« Last Edit: April 18, 2005, 07:09:48 PM by Sichae » Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Freeze
Guest
« Reply #4 on: April 18, 2005, 07:13:08 PM »

Code:
page_header("Ye Olde Bank");
output("`^`c`bYe Olde Bank`b`c");
rawoutput("<center>");
rawoutput("<img src='./images/bank.gif'>");
rawoutput("</center><br>");
$op = httpget('op');

Thats how i got mine to work.

And thats directly int he bank core code.
« Last Edit: April 18, 2005, 07:13:33 PM by Lord Xander » Logged
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #5 on: April 18, 2005, 07:14:09 PM »

Yes. But, that is manually editing the core code, though. Smiley

What is wished to be achieved, is not having to edit the core code.
« Last Edit: April 18, 2005, 07:14:34 PM by Sichae » Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Freeze
Guest
« Reply #6 on: April 18, 2005, 07:23:57 PM »

Oh yeah, well, forgot that part Tongue
Logged
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #7 on: April 18, 2005, 07:28:05 PM »

Code:
<?php

function bankimage_getmoduleinfo(){
   
$info = array(
      
"name"=>"Bank Image",
      
"author"=>"Chris Vorndran",
      
"version"=>"1.0",
      
"category"=>"Images",
      
"settings"=>array(
         
"file"=>"Name of image file,text|",
         
"Make sure to include the extension,note",
      ),
   );
   return 
$info;
}
function 
bankimage_install(){
   
module_addhook("footer-bank");
   return 
true;
}
function 
bankimage_uninstall(){
   return 
true;
}
function 
bankimage_dohook($hookname,$args){
   global 
$session;
   
$file get_module_setting("file");
   switch (
$hookname){
      case 
"footer-bank":
         
$op httpget('op');
         if (
$op == ""){
            if (
$file <> ""){
               
rawoutput("<center>");
               
rawoutput("<img src='./images/$file'>");
               
rawoutput("</center><br>");
            }
         }
         break;
      }
   return 
$args;
}
?>

That will make it display underneath all of the text, which is as close as you will get to actually having an image in there without editing the core code.
« Last Edit: April 18, 2005, 07:28:55 PM by Sichae » Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Play LoGD on Dragonprime

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Who's Online
32 Guests, 0 Users
DragonPrime LoGD
Recent Topics
Home Forums News Links Downloads Login Register Advanced Search