Advertisement:

Author Topic: [Plugin] Print Ad  (Read 27848 times)

Jesse

  • Hero Member
  • *****
  • Posts: 631
  • Out of my mind, back in 5 minutes
[Plugin] Print Ad
« on: February 14, 2012, 03:45:58 pm »
Hi all,

Here is yet another useful plugin... Print Ad.

This plugin will display a simple link, "Print Ad". When clicked, it will open up a new window displaying a printer-friendly page that the user can print. This template is fully and easily customizable.

To use this plugin, download and install, then add this code anywhere on the item.php page you wish to have a "print" link:

Code: [Select]
<?php print_ad(); ?>
« Last Edit: April 26, 2012, 11:07:20 pm by Jesse »

ingo

  • Full Member
  • ***
  • Posts: 216
Re: [New Plugin] Print Ad
« Reply #1 on: February 14, 2012, 04:05:46 pm »
Hi Jesse,

very useful plugin, and already runs on my page  :)

Thanks a lot for this Plugin

Jesse

  • Hero Member
  • *****
  • Posts: 631
  • Out of my mind, back in 5 minutes
Re: [New Plugin] Print Ad
« Reply #2 on: February 14, 2012, 04:07:49 pm »
You're welcome!  :) Glad to hear it's working for you. You're the first one to download and install it, so thanks for testing it out!

ingo

  • Full Member
  • ***
  • Posts: 216
Re: [New Plugin] Print Ad
« Reply #3 on: February 15, 2012, 03:14:31 am »
Hi

I must tell you something, that's spinning in my head all day

such a productivity, in the shortest time (4 days or something) you have created three very important plugins.
I use all your plugins, so slowly I’m getting bad conscience, you can not use my plugins
because I can not write one  :)
PM me your paypal email, so that I donate you at least cup of coffee.

regards

Jesse

  • Hero Member
  • *****
  • Posts: 631
  • Out of my mind, back in 5 minutes
Re: [New Plugin] Print Ad
« Reply #4 on: February 15, 2012, 06:02:52 am »
Thanks Ingo! ;D No funds are needed though for these plugins, as I just enjoy the challenge of programming. Actually, I've always enjoyed being challenged in any form. I'm a newly appointed stay-at-home-dad now with a 2-week old, so when he's sleeping, I've got to keep myself busy doing something. OSClass certainly provides that!   ;)

ingo

  • Full Member
  • ***
  • Posts: 216
Re: [New Plugin] Print Ad
« Reply #5 on: February 15, 2012, 10:30:20 am »

Thank U


congratulations and best wishes to you and your family



Swede

  • Sr. Member
  • ****
  • Posts: 388
Re: [New Plugin] Print Ad
« Reply #6 on: February 15, 2012, 03:12:09 pm »
A nice plugin, once again!

I have problems finding where to translate the link "Print Ad" and allso the texts "Locations:, Descriptions:, Published: and Contact Info:" in the generated document.

ingo

  • Full Member
  • ***
  • Posts: 216
Re: [New Plugin] Print Ad
« Reply #7 on: February 15, 2012, 04:18:55 pm »
Hi Swede,




in print.php from line - 56



    <div id="print"><a href="#" onclick="printpage();"><font color="blue"><b>Print</b></font></a><>




    <div id="title">
   <font size="5"><?php echo $title; ?></font><span class="price"><?php echo $price; ?></span>
    <>


    <div id="info">
   <b>Location:</b><br><?php if($contact_address!='') echo $contact_address.'<br>'; ?><?php echo $city.', '.$region.' - '.$country; ?><br>
   <br>
   <b>Published:</b><br><?php echo $pub_date; ?><br>
   <br>
   <b>Contact Info:</b><br>
      <?php if($contact_name!='') echo $contact_name.'<br>'; ?>
      <?php if($contact_phone!='')echo $contact_phone.'<br>'; ?>
      <?php if($contact_email!='')echo $contact_email.'<br>'; ?>
      <?php if($contact_website!='')echo $contact_website.'<br>'; ?>
   
    <>


    <div id="desc">
   <b>Description:</b> <?php echo $desc; ?>
    <>


    <?php if($image_id[0]!=''){ ?>
    <div id="pictures">
   <div class="pics">
       <?php for($index=0; $index<count($image_id); $index++){ ?>
      <li><img src="<?php echo $image_path[$index].$image_id[$index].'_thumbnail.'.$image_ext[$index]; ?>" width="140"></li>
       <?php  } ?>
   <>
    <>
    <?php } ?>


    <div id="footer">
   This ad was generated by: <b><?php echo $site_title.'</b> - <i>'.$site_url; ?></i>
    <>




</body>
</html>




in index.php line - 87


<a href="#" onClick="formpopup();document.printform.submit();return false;"><img src="'.$path.'icon.jpg" width="25">Print Ad</a>






regards

trains58554

  • Osclass contributor
  • Hero Member
  • *****
  • Posts: 3642
  • osCanyon, the class of Osclass
Re: [New Plugin] Print Ad
« Reply #8 on: February 16, 2012, 12:28:19 am »
Hi Jesse,

This is a very nice plugin. I have one small suggestion for this plugin. If you put all your static text in the translation brackets then your plugin can be translated to other languages.


<?php _e('static text','plugin identifer'); ?>


Jay

Swede

  • Sr. Member
  • ****
  • Posts: 388
Re: [New Plugin] Print Ad
« Reply #9 on: February 16, 2012, 02:03:43 am »
Thx Ingo!!

Jesse

  • Hero Member
  • *****
  • Posts: 631
  • Out of my mind, back in 5 minutes
Re: [New Plugin] Print Ad
« Reply #10 on: February 16, 2012, 03:34:08 am »
Thanks Jay! Yeah, I know my plugins have been lacking language support. It's certainly been the least of my worries. But I'll go through and try and updating them all to allow for proper language translations.  :)

Swede

  • Sr. Member
  • ****
  • Posts: 388
Re: [New Plugin] Print Ad
« Reply #11 on: February 16, 2012, 03:58:19 am »
The generated document dont have the telephone number (extra field) which is a "must have"....

Thx again for a nice plugin!

Jesse

  • Hero Member
  • *****
  • Posts: 631
  • Out of my mind, back in 5 minutes
Re: [New Plugin] Print Ad
« Reply #12 on: February 16, 2012, 04:17:16 am »
Hi Swede,

Yes, the phone number is included (if the ad poster included one in their account user profile).

You can see it working just fine here: http://ivcity.com/osclass/planes/airbus/airbus-a380-good-condition-new-tires_6

Swede

  • Sr. Member
  • ****
  • Posts: 388
Re: [New Plugin] Print Ad
« Reply #13 on: February 16, 2012, 04:29:52 am »
Ahh...
I do understand now that a user have to had entered the phone number during registration... (wich i did not, during registration of my testaccount).
« Last Edit: February 16, 2012, 04:32:37 am by Swede »

Jesse

  • Hero Member
  • *****
  • Posts: 631
  • Out of my mind, back in 5 minutes
Re: [New Plugin] Print Ad
« Reply #14 on: February 16, 2012, 06:23:11 am »
Haha... no problem!  ;)




Update: As for offering additional translations for this plugin (or just the ability to do so), that will not be feasible since the code needed,  _e('some text', 'plugin') will not work with this plugin. That's because the "print.php" page does NOT operate within the OSClass environment... it is its own page, by itself, so NO osclass functions will work with it.

I personally do not see this being an issue. If someone is reading this post, they can understand English good enough to go through the file and change the 5 or 6 text locations.
« Last Edit: February 16, 2012, 10:10:30 am by Jesse »