TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 447
  • Total: 447

[Block] SMF Gallery Random Picture

Started by Thurnok, December 01, 2006, 09:32:24 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jondo

Hi,

I am following up on Laos's post above. We put our broken 'random pics' block back on our main page. Seems to be set up right, it ties to the gallery and shows the text info for the pics, just no thumbs. Also, when you click one of the text peices it takes you to a page that should show the pic, but it doesn't. Any help to get this right would be appreciated.

Jondo - BrokeAss Games

http://www.brokeassgames.com/Community/index.php (block on bottom left)

mr tart

Anyone help with this error message:

Parse error: syntax error, unexpected $end in /home/capital/domains/capitalbocking.co.uk/public_html/bockersworld/Sources/Load.php(1735) : eval()'d code(35) : eval()'d code on line 255

I've literally copy and pasted the code from the first post into a new php block.

G6Cad

Copy and paste the entire code again, make sure you get everything from the code box before you paste it in a php block.
I have used this code so many times i know it's nothing wrong with it.

So redo the block again and test.

MinasC

i used this block for the first time and i noticed that it showed the username of the poster (the one used to login) instead of the real name (the one shown in posts and other members . i replaced this

// display the membername who posted pic?  need to get name based on ID_MEMBER
$gal_tmp = mysql_fetch_assoc(mysql_query("SELECT memberName FROM ".$db_prefix."members WHERE ID_MEMBER = ".$row['ID_MEMBER']));
echo ' by <a href="'.$scripturl.'?action=profile;u='.$row['ID_MEMBER'].'">'.$gal_tmp['memberName'].'</a>';


with this

// display the membername who posted pic?  need to get name based on ID_MEMBER
$gal_tmp = mysql_fetch_assoc(mysql_query("SELECT realName FROM ".$db_prefix."members WHERE ID_MEMBER = ".$row['ID_MEMBER']));
echo ' by <a href="'.$scripturl.'?action=profile;u='.$row['ID_MEMBER'].'">'.$gal_tmp['realName'].'</a>';


and it worked just fine ! i am not a coder , just experimenting , so i have to ask , is that ok ?

i also have 2 questions : how do i change the dimensions of the thumbnail shown in the block , and , how do i change the language of the pic posting date shown in the block (it shows english while everything else is in greek) ?

thnx in advance !

MYBESTHOMESnet

how to edit the code to have latest image in a specific/particular gallery category?

thanks

MinasC

about the date thing , i replaced this

// display the date it was posted
echo ' on '.date("d M Y", $row['date']);
}


with this

// display the date it was posted
echo ' σÏ,,ιÏ, ' . timeformat($row['date']);
}


and it worked !

one more question : is there a way to change the color of the link of the poster's name so that it's the same with the one chosen member color link ?

IchBin

I think the color of the links is controlled with the style.css file.

a:link and a:visted etc.

MinasC

thnx a lot IchBinâ,,¢ , any ideas about the dimensions of the thumbnail ? is there any way i can change them ?

MinasC

Quote from: MYBESTHOMESnet on October 01, 2007, 02:11:36 AM
how to edit the code to have latest image in a specific/particular gallery category?

thanks

it's easy i think ! (as i previously said i am not a coder , so if anyone knowing coding sees anything wrong please advice !)
just replace this

// use random, or most recent pics?
// 0 = random, 1 = most recent, 2 = most viewed, 3 = most commented
$gal_showtype = 0;


with this

// use random, or most recent pics?
// 0 = random, 1 = most recent, 2 = most viewed, 3 = most commented
$gal_showtype = 1;


that will show the last pic added in your gallery ! now if you want it to show the last pic added in a specific category you have to replace this

// select only from the following cats - leave empty for all - NOTE:($gal_disallowCats overrides)
// example: $gal_allowCats = "1,3,4" - show only categories 1, 3, and 4
$gal_allowCats = "";


with this

// select only from the following cats - leave empty for all - NOTE:($gal_disallowCats overrides)
// example: $gal_allowCats = "1,3,4" - show only categories 1, 3, and 4
$gal_allowCats = "4";


assuming off course that 4 is the number of the category you want the block to show . an easy way to find out what's your category number is to go to your gallery and click on the link of that category and check the url address of your browser , it should be something like

http://www.yoursite.com/index.php?action=gallery;cat=4

Rabain

This is awesome...it's only taken me about 2 hours to find it and a lot of reading through posts at the SMF forum.

Great stuff!

This website is proudly hosted on Crocweb Cloud Website Hosting.