Previous Thread
Next Thread
Print Thread
Rating: 16
Page 3 of 3 1 2 3
Joined: Mar 2004
Posts: 2
Lurker
Lurker
Joined: Mar 2004
Posts: 2
sweet mod rigged it up no worries. any ideas on how to mod a thumbnail view that opens in a new window when clicked to show the full image...

Sponsored Links
Joined: Aug 2002
Posts: 100
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 100
[]Trav said:
I looked at the code, and I changed this line:

if ($config['inline_anon'] == "yes") {


to this:

if (($config['inline_anon'] == "yes") && ($Groups != "-4-")) {


It works fine now. The inline_anon variable isn't much but a way to toggle this feature on/off though. I am guessing something changed in one of the versions prior to 6.3.2 to prevent the inline_anon feature from working right. <shrug> I dunno. Anyway, ericgtr, try this out. It solved my problem, and I was having the exact same problem that you were (with inline images only working if inline_anon was set to 'yes').

[/]

Small simple question... How would one put more than one group into this? Like allowing groups 5 to 8 to only see the images?

Would there be a way in this mod to make it so only groups 5 to 8 would be able to even post an attachment?

Joined: Oct 2001
Posts: 157
Member
Member
Offline
Joined: Oct 2001
Posts: 157
A question...

We could not use the modified version of this mod which resizes the uploaded image. At about 500 images being uploaded everyday, it was just too resource intensive and the server became extremely slow and stalled occassionally. So we reverted back to the basic version.

Now, with that kind of image upload, we have a big server load anyway. Therefore, we would like to display a thumbnail of the attached image rather than a resized image. However, even if I request such a mod, will it also be a major server load issue?

Basically, what I am asking is if resizing and thumbnailing is handled differently. If yes, will thumbnails (clicking on which will go to the original image -- photopost style) be less resource intensive? If yes, can that be in the next version?

Last edited by crescendo; 05/30/2004 9:05 AM.

Yors Truly

Who? Me? Worry?
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
You'd need something like www.photopost.com to generate thumbnail images (either using ImageMagik or the GD library of PHP) - threads doesn't have this ability and a "mod" for it would be very involved... essentially recreating the photopost program.

The best you could do is "resize" the image to thumnail size - and that's what this mod does. Just adjust the size smaller.

Joined: Aug 2002
Posts: 100
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 100
[]JoshPet said:
You'd need something like www.photopost.com to generate thumbnail images (either using ImageMagik or the GD library of PHP) - threads doesn't have this ability and a "mod" for it would be very involved... essentially recreating the photopost program.

The best you could do is "resize" the image to thumnail size - and that's what this mod does. Just adjust the size smaller. [/]

Photopost is amazing software to use with threads... Of course, if you choose to just use re-sizing, you will basicly use twice the bandwidth than you would if you just showed the full size attachment. (Once to load the full size pic into a smaller resized thumb, and then again when someone clicks on it...) Not what you are looking for.

Hope someone can help with my question too

[]
Small simple question... How would one put more than one group into this? Like allowing groups 5 to 8 to only see the images?
[/]

So only users in groups 5,6,7,8 can download or see the attachments?


Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Code
<br />if (($config['inline_anon'] == "yes") && (($Groups == "-5-") || ($Groups == "-8-"))) { <br />


That should allow only groups 5 & 8 to see the images.

Joined: Aug 2002
Posts: 100
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 100
Awesome Josh, i was wondering if that would do it... (Remember somethign like this in one other mod i did)

Wondering if that will also only allow those users to download attachments too then? Or can anyone still download them? (but only those groups can SEE the inline images?)

Deej

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
That only handles the inline images.

You'd need to modify download.php to restrict the download action.

Code
<br />## In download.php<br /><br />## Find this:<br /><br />   $user = $userob -> authenticate("U_Groups");<br /><br /><br />## BELOW it, ADD this:<br /><br />if ((!strstr($user['U_Groups'],"-5-")) && (!strstr($user['U_Groups'],"-8-"))) {<br />$html = new html;<br />$html -> not_right("You are not authorized to download.",$Cat);<br />}<br />




Also - looking at the above code for the inline image mod - that'll only work if the user is only in a single group - if they are in multiple groups, we'll want to change that code to this instead:
Code
<br />if (($config['inline_anon'] == "yes") && ( (strstr($Groups,"-5-")) || (strstr($Groups,"-8-")) )) { <br /><br />

Joined: Aug 2002
Posts: 100
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 100
[]JoshPet said:
Code
<br />if (($config['inline_anon'] == "yes") && (($Groups == "-5-") || ($Groups == "-8-"))) { <br />


That should allow only groups 5 & 8 to see the images. [/]

Awesome again.... Love this site, and all you do to help... (Insert ass kissing here... grin)

This line of code above, where do I insert that? (Want to be sure to put it in the right place.

This will work out awesome. Im sure it will come in handy for others with paid supporting members too!

D

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
That code is for the inline image mod - use that line instead of the one you noted here:
https://www.ubbdev.com/forum/showthreaded.php/Number/114387

Sponsored Links
Joined: Aug 2002
Posts: 100
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 100
Post deleted by Deejay

Joined: Aug 2002
Posts: 100
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 100
Ok, here is what i am running now in the showflat.php for the inline image mod... to only show the incline image to groups 1,2, 5,6,7,8 ...

if ((($Groups == "-1-") || ($Groups == "-2-") || ($Groups == "-5-") || ($Groups == "-6-") || ($Groups == "-7
-") || ($Groups == "-8-")) || ((!$user['U_Username']) && ($config['inline_anon'] == "yes"))){

BUT, it will only show the inline images to groups 5 to 8 and not the admins or mods?

It does NOT show it to normal users or guests though.. WHich is good. Half way there?

HELP? Ive been trying to hack this this afternoon, but cant figure out why the admins and mods can see the inlines? Other than that its working ok for the supporting member groups 5 to 8


Deej

Joined: Aug 2002
Posts: 100
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 100
Im really hammering on this this afternoon... (grin)

For the bit of script to restrict the downloading of attachments to only certain groups... Here is what I did... I think here MIGHT have been a typo in your code josh, as I had to do some moving of brackets a bit...

In the download.php script as you said above:

if ((!strstr($user['U_Groups'],"-1-")) && (!strstr($user['U_Groups'],"-2-")) && (!strstr($user['U_Groups'],"-5-")) && (!strstr($user
['U_Groups'],"-6-")) && (!strstr($user['U_Groups'],"-7-")) && (!strstr($user['U_Groups'],"-8-"))){
$html = new html;
$html -> not_right("Only supporting members are authorized to download attachments.<br>You can be a supporting member by signing up
<a href="http://www.atvcanada.ca\amember\signup.php"> HERE!</a>",$Cat);
}

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Yeah, that's why I said that wouldn't work - Admins and moderators will have more than one group in their profile. Use the code I posted above using strstr.

Joined: Aug 2002
Posts: 100
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 100
Ok, i get it... So i did this then to it:

if ((($Groups == "-1-") || ($Groups == "-2-") || ($Groups == "-5-") || ($Groups == "-6-") || ($Groups == "-7-") || ($Groups == "-8-") || ($user['U_Status'] == "Administrator") || ($user['U_Status'] == "Moderator")) || ((!$user['U_Username']) && ($config['inline_anon'] == "yes"))){

And it seems to work now

THanks so much for your help Josh...

Now i just need to figure out how to get the uploading of attachments restricted to only those groups too...

Deej

Joined: Aug 2002
Posts: 100
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 100
One more idea...

I notice there is a if/else thing going on in this stuff... And was wondering how I would get it to show a small image or line of text that says "Become a supporting member to see this image." or something like that. Even maybe linking that to the signup page?

Not sure where in the inline mod to add this?

Deej

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
OK -you went way out of your way not to use the code I posted the first time you asked.
https://www.ubbdev.com/forum/showthreaded.php/Number/114508


The Group == '-5-' bit only works if they have one group. Most sites will have people as members of multiple groups.

So strstr is best. That searches for a pattern within strstr(haystack,needle)


So if the user's group is "-1-2-3-5-"


Then you could say:

if (strstr($Groups,"-5-")) {
// Would apply to anyone's string of groups containing "-5-"
}

Joined: Aug 2002
Posts: 100
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 100
Ahhhhhhhhh... Jeesh, didnt know thats why that was.... I learned something new again today then... (Well, a few things I spose!)

BTW i edited out the -1- and -2- parts anyways, because i got it with the user status crap anyways


Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
The more you modify - the more you learn.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
if thats the case my head will soon explode into a zillion pieces....

Joined: Jun 2003
Posts: 88
Power User
Power User
Offline
Joined: Jun 2003
Posts: 88
I have the same issue..cant get it to work..I copied and pasted everything according to instructions...added the 2 lines to the config.inc file and still no dice..no errors...just wont show up in the body. I am running 6.4..I inserted this in the config file
$config['max_width'] = 500;
$config['inline_anon'] = 'yes';

and did a find and replace on the 2 php files that were in Josh's original instructions

Page 3 of 3 1 2 3

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)