Home
Scripts
Contributions (Pro Mod Access)
FAQ's
Downloads
Support Forum
  SnailSource.com [Logo]
Calendar LiteCalendar Lite (Demo)
Calendar ProCalendar Pro (Demo)
LinksLinks Pro (Demo)
Log in to check your private messagesForum
RegisterRegister
Log inLog in
Log in to check your private messagesLog in to check your private messages SearchSearch FAQFAQ ProfileProfile MemberlistMemberlist UsergroupsUsergroups Join GroupsJoin Groups

Random Photo Block?
Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9  Next
 
Post new topic   Reply to topic   printer-friendly view    SnailSource.com Forum Index -> Gallery->phpBB2 Integration Support printer-friendly view
View previous topic :: View next topic  
Author Message
spectre



Joined: 01 Aug 2002
Posts: 22



Hlp* 0.10
PostPosted: Thu Aug 01, 2002 5:27 pm    Post subject: Random Photo Block? Reply with quote Direct link

Has anyone made a random photo block for the front page of their website? I saw one in the contributions sections of the gallery site but it's for nuke/postnuke. Could it be modified for phpBB2?
Back to top
View user's profile Send private message Visit poster's website
Martin
Site Admin


Joined: 24 Mar 2002
Posts: 8182



Hlp* 3655.72
PostPosted: Thu Aug 01, 2002 5:30 pm    Post subject: Re: Random Photo Block? Reply with quote Direct link

spectre wrote:
Has anyone made a random photo block for the front page of their website? I saw one in the contributions sections of the gallery site but it's for nuke/postnuke. Could it be modified for phpBB2?

Good question... I personally have never done it, but I'd assume that if it's possible for post Nuke, then it's possible for phpBB2 as well... Just a matter of examining the code...

... and no, sorry I won't be looking at that... Good luck with your search though. Wink
Back to top
View user's profile Send private message
spectre



Joined: 01 Aug 2002
Posts: 22



Hlp* 0.10
PostPosted: Thu Aug 29, 2002 7:01 pm    Post subject: Well heres my solution. Reply with quote Direct link

After banging my head against all the scripts and asking around this is what I did to get the random photo script working for my phpBB2 + gallery integration:

  1. Obtain and apply the block-random.php script from the gallery site: current location, they are moving things around so you may have to search.
  2. Unless you have the mod to allow php in your tpl's your going to have to have a seperate php page. I'll call it the home page.
  3. Put an include statement in your home page that looks like this:
    Code:
    <?
    include ("http://www.your-site.net/your-phpbb-root/modules.php?op=modload&name=gallery&file=index&include=block-random.php");
    ?>

  4. I had to modify the block-random.php script to include my phpbb-root path as follows:
    FIND:
    Code:
    if (isset($index)) {
        $id = $album->getPhotoId($index);
        echo ""
           ."<a href=" .makeAlbumUrl($album->fields["name"], $id) .">"
           .$album->getThumbnailTag($index)
           ."</a>";
       
        $caption = $album->getCaption($index);
        if ($caption) {
       echo "<br><center>$caption</center>";
        }
       
        echo "<br><center>From: "
           ."<a href=" .makeAlbumUrl($album->fields["name"]) .">"
           .$album->fields["title"]
           ."</a></center>";
    } else {
       print "No photo chosen.";
    }
    CHANGE TO:
    Code:
    if (isset($index)) {
        $id = $album->getPhotoId($index);
        echo ""
           ."<a href=" . "forums/" . makeAlbumUrl($album->fields["name"], $id) .">"
           .$album->getThumbnailTag($index)
           ."</a>";
       
        $caption = $album->getCaption($index);
        if ($caption) {
       echo "<br><center>$caption</center>";
        }
       
        echo "<br><center>From: "
           ."<a href=" . "forums/" . makeAlbumUrl($album->fields["name"]) .">"
           .$album->fields["title"]
           ."</a></center>";
    } else {
       print "No photo chosen.";
    }
    Where I have "forums/" above you would replace with your phpbb root path relative to your home page.
  5. Thats what I did. I'm kinda new to this so use at your own risk. If you can make it better please continue this thread.

Thanks Very Happy
Back to top
View user's profile Send private message Visit poster's website
fishfreek



Joined: 25 May 2002
Posts: 93



Hlp* 0.10
PostPosted: Thu Aug 29, 2002 7:49 pm    Post subject: Reply with quote Direct link

can I see a working example?
Back to top
View user's profile Send private message
spectre



Joined: 01 Aug 2002
Posts: 22



Hlp* 0.10
PostPosted: Thu Aug 29, 2002 8:02 pm    Post subject: Example Reply with quote Direct link

fishfreek wrote:
can I see a working example?
Laughing opps here you go: my family home page
Back to top
View user's profile Send private message Visit poster's website
fishfreek



Joined: 25 May 2002
Posts: 93



Hlp* 0.10
PostPosted: Thu Aug 29, 2002 8:39 pm    Post subject: Reply with quote Direct link

Thats real sweet.

Im gonna install it when I get home.

I will post a link here when its working to show two examples. I think I am gonna make the title of the box be a link to the photo gallery.
Back to top
View user's profile Send private message
Martin
Site Admin


Joined: 24 Mar 2002
Posts: 8182



Hlp* 3655.72
PostPosted: Thu Aug 29, 2002 8:52 pm    Post subject: Reply with quote Direct link

Congrats Spectre, welcome to the brotherhood of frustrated integration mod'ers...

*...passes monk like robe to initiate*

Looks very good and I'm sure will earn you lots of support requests and the occassional nugget of praise... Wink
Back to top
View user's profile Send private message
fishfreek



Joined: 25 May 2002
Posts: 93



Hlp* 0.10
PostPosted: Thu Aug 29, 2002 9:24 pm    Post subject: Reply with quote Direct link

Well martin, I will give prase once i get it working.

I do have one question to start out with. Where did you place your block-random.php file? Did you place it in the same directory as the gallery install? Did you place it in the phpbb root directory?

Ill answer my own question. Looks like you place it in the gallery directory.
Back to top
View user's profile Send private message
Martin
Site Admin


Joined: 24 Mar 2002
Posts: 8182



Hlp* 3655.72
PostPosted: Thu Aug 29, 2002 9:36 pm    Post subject: Reply with quote Direct link

fishfreek wrote:
Well martin, I will give prase once i get it working.

Ah but not full praIse I see... budget cut backs it seems Very Happy

Quote:
I do have one question to start out with. (snip)

Ill answer my own question. Looks like you place it in the gallery directory.


Yep... that would figure... Smile
Back to top
View user's profile Send private message
fishfreek



Joined: 25 May 2002
Posts: 93



Hlp* 0.10
PostPosted: Thu Aug 29, 2002 9:49 pm    Post subject: Reply with quote Direct link

Ok, since the above information told how to get the basics going I wrote up a small php script to format it like the rest of the phpbb blocks.

Quote:
<head><link rel="stylesheet" href="../templates/subSilver/subSilver.css"></head>
<table width="180" cellpadding="3" cellspacing="0" border="0" class="forumline">
<tr>
<td height="28" class="catSides"><span class="cattitle"><a href="modules.php?op=modload&name=gallery&file=index" class="cattitle">Random Gallery Photo</a></span></td>
</tr>
<tr>
<td class="row1" align="center" valign="middle" height="25"><? include ("http://www.aquariumadvice.com/modules.php?op=modload&name=gallery&file=index&include=block-random.php")?></span></td>
</tr>
</tr>
</table>

I titled this file random.php then I called it with an include in my site index by using simular include code
Quote:
include ('random.php');
ECHO '<BR />';


The random.php file is in the root of the website or the same directory as the file your include is written in.

You can see the finished result at http://www.aquariumadvice.com
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    SnailSource.com Forum Index -> Gallery->phpBB2 Integration Support All times are GMT
Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9  Next
Page 1 of 9

 
Jump to:  
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

This board is protected by Phpbbantispam
Board Security

15564 Attacks blocked

Powered by phpBB © 2001, 2005 phpBB Group