Advertisement:
2by2host

Author Topic: APImage  (Read 22227 times)

Offline lurkalot

  • Full Member
  • ***
  • Posts: 421
  • Gender: Male
  • Tinyportal Support
    • guitaristguild on Facebook
    • @GuitaristGuild on Twitter
    • CameraCraniums
Re: APImage
« Reply #100 on: June 03, 2012, 03:49:09 PM »
Here you go.

Code: [Select]
/////////////////////
// Set up the topic where the poll is.
$pollTopic = 3;

// Set poll topic subject
$polltext = "<center><b><h3>Subject = Abstract: Voting closes: 31 October 2010, 07:10:52</h3></b></center>" ;
/////////////////////

// Images per row.
$imagesPerRow = 3;

$pollResults = ssi_showPoll($pollTopic,'array');

// Just a counter..
$imageCount = 0;

global $scripturl, $context;

$patternImg = "/src=[\"']?([^\"']?.*(png|jpg|gif))[\"']?/i";

echo ' <center><b><h2>Poll for the weekly competition</h2></b></center> ';
echo $polltext ;

echo ' <hr> ';
echo '
      <table style="width: 100%">
         <tr>';

foreach ($pollResults['options'] as $pollItem)
{
   preg_match($patternImg, $pollItem['option'], $image);   
   
   $imageCount++;
   
   if ($imageCount > $imagesPerRow)
   {
      echo '
         </tr>
         <tr>';
   
      $imageCount = 1;
   }
   
   echo '
            <td style="width: 25%; text-align: center; padding: 1px 1px 10px 1px;">
               <a href="' , $scripturl , '?topic=' , $pollTopic , '">
                  <img ' , $image[0] , ' alt="Go Vote !" title="Go Vote !" border="0" width="100" />
               </a>
               <br />
               Member : ' , strip_tags($pollItem['option']);
               
   if (!$pollResults['allow_vote'] && !$context['user']['is_guest'])
   {
      echo '
               <br />
               Votes : ' , $pollItem['votes'] , ' (' , $pollItem['percent'] , '%)
               <br />
               ' , $pollItem['bar'];
   }

      echo '
            </td>';
     
}

while ($imageCount < $imagesPerRow)
{
   echo '
            <td style="width: 25%">
            </td>';
   
   $imageCount++;
}

echo '
         </tr>
      </table>';
echo ' <center><b>Please click on any image to take you to the poll</b></center> ';
Tinyportal support team.
Coppermine Gallery support team.

Camera Craniums Running SMF 2.0.4 / Tinyportal 1.0, bridged with Coppermine 1.5.20, SMF Arcade 2.5

Guitarist Guild Running SMF 2.0.4 / Tinyportal 1.0

Offline anteprimorac

  • Jr. Member
  • **
  • Posts: 275
  • Gender: Male
    • anteprimorachr on Facebook
    • @anteprimorac on Twitter
    • AntePrimorac.from.hr
Re: APImage
« Reply #101 on: June 03, 2012, 05:53:02 PM »
Replace with:
Code: [Select]
/////////////////////
// Set up the topic where the poll is.
$pollTopic = 3;

// Set poll topic subject
$polltext = "<center><b><h3>Subject = Abstract: Voting closes: 31 October 2010, 07:10:52</h3></b></center>" ;
/////////////////////

// Images per row.
$imagesPerRow = 3;

$pollResults = ssi_showPoll($pollTopic,'array');

// Just a counter..
$imageCount = 0;

global $scripturl, $context;

$patternImg = "/data-image=[\"']?([^\"']?.*(png|jpg|gif))[\"']?/i";

echo ' <center><b><h2>Poll for the weekly competition</h2></b></center> ';
echo $polltext ;

echo ' <hr> ';
echo '
      <table style="width: 100%">
         <tr>';

foreach ($pollResults['options'] as $pollItem)
{
   preg_match($patternImg, $pollItem['option'], $image);   
   
   $imageCount++;
   
   if ($imageCount > $imagesPerRow)
   {
      echo '
         </tr>
         <tr>';
   
      $imageCount = 1;
   }
   
   echo '
            <td style="width: 25%; text-align: center; padding: 1px 1px 10px 1px;">
               <a href="' , $scripturl , '?topic=' , $pollTopic , '">
                  <div class="apimage" data-image="' , $image[0] , '" data-width="100" />
               </a>
               <br />
               Member : ' , strip_tags($pollItem['option']);
               
   if (!$pollResults['allow_vote'] && !$context['user']['is_guest'])
   {
      echo '
               <br />
               Votes : ' , $pollItem['votes'] , ' (' , $pollItem['percent'] , '%)
               <br />
               ' , $pollItem['bar'];
   }

      echo '
            </td>';
     
}

while ($imageCount < $imagesPerRow)
{
   echo '
            <td style="width: 25%">
            </td>';
   
   $imageCount++;
}

echo '
         </tr>
      </table>';
echo ' <center><b>Please click on any image to take you to the poll</b></center> ';
My Mods:
APImage v0.3




Besplatni singlovi, doublovi, listići, ... svih sportova! - BalkanTips

Offline anteprimorac

  • Jr. Member
  • **
  • Posts: 275
  • Gender: Male
    • anteprimorachr on Facebook
    • @anteprimorac on Twitter
    • AntePrimorac.from.hr
Re: APImage
« Reply #102 on: June 03, 2012, 06:11:53 PM »
my mistake, this will work well:
Code: [Select]
/////////////////////
// Set up the topic where the poll is.
$pollTopic = 3;

// Set poll topic subject
$polltext = "<center><b><h3>Subject = Abstract: Voting closes: 31 October 2010, 07:10:52</h3></b></center>" ;
/////////////////////

// Images per row.
$imagesPerRow = 3;

$pollResults = ssi_showPoll($pollTopic,'array');

// Just a counter..
$imageCount = 0;

global $scripturl, $context;

$patternImg = "/data-image=[\"']?([^\"']?.*(png|jpg|gif))[\"']?/i";

echo ' <center><b><h2>Poll for the weekly competition</h2></b></center> ';
echo $polltext ;

echo ' <hr> ';
echo '
      <table style="width: 100%">
         <tr>';

foreach ($pollResults['options'] as $pollItem)
{
   preg_match($patternImg, $pollItem['option'], $image);   
   
   $imageCount++;
   
   if ($imageCount > $imagesPerRow)
   {
      echo '
         </tr>
         <tr>';
   
      $imageCount = 1;
   }
   
   echo '
            <td style="width: 25%; text-align: center; padding: 1px 1px 10px 1px;">
               <a href="' , $scripturl , '?topic=' , $pollTopic , '">
                  <div class="apimage" ' , $image[0] , ' data-width="100"></div>
               </a>
               <br />
               Member : ' , strip_tags($pollItem['option']);
               
   if (!$pollResults['allow_vote'] && !$context['user']['is_guest'])
   {
      echo '
               <br />
               Votes : ' , $pollItem['votes'] , ' (' , $pollItem['percent'] , '%)
               <br />
               ' , $pollItem['bar'];
   }

      echo '
            </td>';
     
}

while ($imageCount < $imagesPerRow)
{
   echo '
            <td style="width: 25%">
            </td>';
   
   $imageCount++;
}

echo '
         </tr>
      </table>';
echo ' <center><b>Please click on any image to take you to the poll</b></center> ';

EDIT:
Link problem is resloved!
My Mods:
APImage v0.3




Besplatni singlovi, doublovi, listići, ... svih sportova! - BalkanTips

Offline lurkalot

  • Full Member
  • ***
  • Posts: 421
  • Gender: Male
  • Tinyportal Support
    • guitaristguild on Facebook
    • @GuitaristGuild on Twitter
    • CameraCraniums
Re: APImage
« Reply #103 on: June 03, 2012, 06:16:57 PM »
Thanks, it does now work.  But it's showing two images where each image should be. http://cctestsite.info
Tinyportal support team.
Coppermine Gallery support team.

Camera Craniums Running SMF 2.0.4 / Tinyportal 1.0, bridged with Coppermine 1.5.20, SMF Arcade 2.5

Guitarist Guild Running SMF 2.0.4 / Tinyportal 1.0

Offline anteprimorac

  • Jr. Member
  • **
  • Posts: 275
  • Gender: Male
    • anteprimorachr on Facebook
    • @anteprimorac on Twitter
    • AntePrimorac.from.hr
Re: APImage
« Reply #104 on: June 03, 2012, 06:21:05 PM »
Code in previous post is updated.
Thanks, it does now work.  But it's showing two images where each image should be. http://cctestsite.info
What you mean?
My Mods:
APImage v0.3




Besplatni singlovi, doublovi, listići, ... svih sportova! - BalkanTips

Offline lurkalot

  • Full Member
  • ***
  • Posts: 421
  • Gender: Male
  • Tinyportal Support
    • guitaristguild on Facebook
    • @GuitaristGuild on Twitter
    • CameraCraniums
Re: APImage
« Reply #105 on: June 03, 2012, 06:39:27 PM »
Here's a screengrab,  ;)
Tinyportal support team.
Coppermine Gallery support team.

Camera Craniums Running SMF 2.0.4 / Tinyportal 1.0, bridged with Coppermine 1.5.20, SMF Arcade 2.5

Guitarist Guild Running SMF 2.0.4 / Tinyportal 1.0

Offline anteprimorac

  • Jr. Member
  • **
  • Posts: 275
  • Gender: Male
    • anteprimorachr on Facebook
    • @anteprimorac on Twitter
    • AntePrimorac.from.hr
Re: APImage
« Reply #106 on: June 03, 2012, 06:42:09 PM »
try this:
Code: [Select]
/////////////////////
// Set up the topic where the poll is.
$pollTopic = 3;

// Set poll topic subject
$polltext = "<center><b><h3>Subject = Abstract: Voting closes: 31 October 2010, 07:10:52</h3></b></center>" ;
/////////////////////

// Images per row.
$imagesPerRow = 3;

$pollResults = ssi_showPoll($pollTopic,'array');

// Just a counter..
$imageCount = 0;

global $scripturl, $context;

$patternImg = "/data-image=[\"']?([^\"']?.*(png|jpg|gif))[\"']?/i";

echo ' <center><b><h2>Poll for the weekly competition</h2></b></center> ';
echo $polltext ;

echo ' <hr> ';
echo '
      <table style="width: 100%">
         <tr>';

foreach ($pollResults['options'] as $pollItem)
{
   preg_match($patternImg, $pollItem['option'], $image);   
   
   $imageCount++;
   
   if ($imageCount > $imagesPerRow)
   {
      echo '
         </tr>
         <tr>';
   
      $imageCount = 1;
   }
   
   echo '
            <td style="width: 25%; text-align: center; padding: 1px 1px 10px 1px;">
               <a href="' , $scripturl , '?topic=' , $pollTopic , '">
                  <div class="apimage" ' , $image[0] , ' data-width="100"></div>
               </a>
               <br />
               Member : ' , strip_tags($pollItem['option']);
               
   if (!$pollResults['allow_vote'] && !$context['user']['is_guest'])
   {
      echo '
               <br />
               Votes : ' , $pollItem['votes'] , ' (' , $pollItem['percent'] , '%)
               <br />
               ' , $pollItem['bar'];
   }

      echo '
            </td>';
     
}

while ($imageCount < $imagesPerRow)
{
   echo '
            <td style="width: 25%">
            </td>';
   
   $imageCount++;
}

echo '
         </tr>
      </table>';
echo ' <center><b>Please click on any image to take you to the poll</b></center> ';
My Mods:
APImage v0.3




Besplatni singlovi, doublovi, listići, ... svih sportova! - BalkanTips

Offline lurkalot

  • Full Member
  • ***
  • Posts: 421
  • Gender: Male
  • Tinyportal Support
    • guitaristguild on Facebook
    • @GuitaristGuild on Twitter
    • CameraCraniums
Re: APImage
« Reply #107 on: June 03, 2012, 06:54:00 PM »
Really sorry for messing you about. You've spent a lot of time on this for me.

The images show correctly now, but they seem to be aligned to the left and not with the text below them as they used to be. 

Been thinking long and hard over this mod, and although it's a great mod, I'm now wondering if it's going to work out when using it with Tinyportal.  Trouble is it effects all images in my blocks, which I'd rather it didn't.  It would be great if I could make it ignore any images in my blocks.  Or my front page come to think of it.
Tinyportal support team.
Coppermine Gallery support team.

Camera Craniums Running SMF 2.0.4 / Tinyportal 1.0, bridged with Coppermine 1.5.20, SMF Arcade 2.5

Guitarist Guild Running SMF 2.0.4 / Tinyportal 1.0

Offline anteprimorac

  • Jr. Member
  • **
  • Posts: 275
  • Gender: Male
    • anteprimorachr on Facebook
    • @anteprimorac on Twitter
    • AntePrimorac.from.hr
Re: APImage
« Reply #108 on: June 03, 2012, 07:05:06 PM »
In version 0.3 you will be able to turn off mod on single image.
My Mods:
APImage v0.3




Besplatni singlovi, doublovi, listići, ... svih sportova! - BalkanTips

Offline lurkalot

  • Full Member
  • ***
  • Posts: 421
  • Gender: Male
  • Tinyportal Support
    • guitaristguild on Facebook
    • @GuitaristGuild on Twitter
    • CameraCraniums
Re: APImage
« Reply #109 on: June 03, 2012, 07:16:08 PM »
In version 0.3 you will be able to turn off mod on single image.

That sounds good.  Would be great if we could choose which images it's applied to. 

Would love it if it ignored portal blocks, unless required.  And the same for images entered into the poll option fields.  I'll wait for the next version then.  Good luck with that. ;)  Also If you'd like me to test, or you'd like to test yourself in Tinyportal etc, then just give me a shout.
Tinyportal support team.
Coppermine Gallery support team.

Camera Craniums Running SMF 2.0.4 / Tinyportal 1.0, bridged with Coppermine 1.5.20, SMF Arcade 2.5

Guitarist Guild Running SMF 2.0.4 / Tinyportal 1.0

Offline anteprimorac

  • Jr. Member
  • **
  • Posts: 275
  • Gender: Male
    • anteprimorachr on Facebook
    • @anteprimorac on Twitter
    • AntePrimorac.from.hr
Re: APImage
« Reply #110 on: June 03, 2012, 07:17:59 PM »
ok, no problem ;)
My Mods:
APImage v0.3




Besplatni singlovi, doublovi, listići, ... svih sportova! - BalkanTips

Offline loplo

  • Semi-Newbie
  • *
  • Posts: 66
Re: APImage
« Reply #111 on: June 05, 2012, 09:45:33 AM »
One more thing. Images are not being parsed and showed on facebook.

Offline edgarlim

  • Newbie
  • *
  • Posts: 4
Re: APImage
« Reply #112 on: June 12, 2012, 12:45:58 PM »
hello!

don't wanna hurry you, just wanna know when 0.3 is coming  ;)

ed

Offline anteprimorac

  • Jr. Member
  • **
  • Posts: 275
  • Gender: Male
    • anteprimorachr on Facebook
    • @anteprimorac on Twitter
    • AntePrimorac.from.hr
Re: APImage
« Reply #113 on: June 12, 2012, 03:20:07 PM »
One more thing. Images are not being parsed and showed on facebook.
That will be resloved in new version.

hello!

don't wanna hurry you, just wanna know when 0.3 is coming  ;)

ed
This weekend or next week ;)
My Mods:
APImage v0.3




Besplatni singlovi, doublovi, listići, ... svih sportova! - BalkanTips

Offline edgarlim

  • Newbie
  • *
  • Posts: 4
Re: APImage
« Reply #114 on: July 04, 2012, 12:50:49 AM »
0.3?  ;)

Offline anteprimorac

  • Jr. Member
  • **
  • Posts: 275
  • Gender: Male
    • anteprimorachr on Facebook
    • @anteprimorac on Twitter
    • AntePrimorac.from.hr
Re: APImage
« Reply #115 on: July 05, 2012, 10:41:48 AM »
coming soon
My Mods:
APImage v0.3




Besplatni singlovi, doublovi, listići, ... svih sportova! - BalkanTips

Offline anteprimorac

  • Jr. Member
  • **
  • Posts: 275
  • Gender: Male
    • anteprimorachr on Facebook
    • @anteprimorac on Twitter
    • AntePrimorac.from.hr
Re: APImage
« Reply #116 on: July 06, 2012, 08:22:12 PM »
First I want to apologize for the delay development of new versions. I'm sorry but you have to apprehend a few more days.
My Mods:
APImage v0.3




Besplatni singlovi, doublovi, listići, ... svih sportova! - BalkanTips

Offline anteprimorac

  • Jr. Member
  • **
  • Posts: 275
  • Gender: Male
    • anteprimorachr on Facebook
    • @anteprimorac on Twitter
    • AntePrimorac.from.hr
Re: APImage
« Reply #117 on: July 24, 2012, 01:10:56 PM »
Version 0.3
! APImage is turned off in signatures and Tinyportal blocks
+ New design
+ Custom scrollbar in gallery
+ Turn off APImage on a single image
+ Watermarks
+ Slideshow
+ Gallery tag button
+ Free advertising, submit your ad here
My Mods:
APImage v0.3




Besplatni singlovi, doublovi, listići, ... svih sportova! - BalkanTips

Offline loplo

  • Semi-Newbie
  • *
  • Posts: 66
Re: APImage
« Reply #118 on: July 24, 2012, 01:35:56 PM »
Wow, thanks.
Any instructions how to upgrade? Does it need some special moves? like backup some lines of code, delete, etc?

Offline anteprimorac

  • Jr. Member
  • **
  • Posts: 275
  • Gender: Male
    • anteprimorachr on Facebook
    • @anteprimorac on Twitter
    • AntePrimorac.from.hr
Re: APImage
« Reply #119 on: July 24, 2012, 01:40:48 PM »
- Uninstall and delete old version
- Upload and install new version

after installation you need to clear cache in your browser
My Mods:
APImage v0.3




Besplatni singlovi, doublovi, listići, ... svih sportova! - BalkanTips