Welcome, Guest. Please Login or Register.
April 25, 2024, 01:48:27 AM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Completed mods  |  Adding Images to Boardindex « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Adding Images to Boardindex  (Read 2171 times)
Fizzy
Full Member
***
Posts: 214


Adding Images to Boardindex
« on: February 22, 2003, 06:27:48 PM »
Reply with quote

Hi guys,

I was looking for a way to add a gif at the start of each Board Description.
I couldn't find anything to do what I wanted but got inpiration from a Mod Request for Category clickable icons.

This isn't a mod, by a long stretch of the imagination, this is just a "Me sharing how I stumbled through and came up with a solution" type thing.

OK, Open MySQL tables, edit "Boards" table and add a field called "boardpic"
In that field add image urls.

Then, open BoardIndex in your editor and locate


      SELECT DISTINCT c.name AS catName, c.ID_CAT, b.ID_BOARD, b.name AS boardName, b.description, b.moderators, b.numPosts, b.numTopics, c.memberGroups, m.posterName, m.posterTime, m.subject, t.ID_TOPIC, t.numReplies, IFNULL(mem.realName, m.posterName) AS realName, IFNULL(lb.logTime, 0) AS boardTime, IFNULL(lmr.logTime, 0) AS markReadTime, IFNULL(mem.ID_MEMBER, -1) AS ID_MEMBER


add

b.boardpic


so you then should have something like


      SELECT DISTINCT c.name AS catName, c.ID_CAT, b.ID_BOARD, b.name AS boardName, b.description, b.boardpic, b.moderators, b.numPosts, b.numTopics, c.memberGroups, m.posterName, m.posterTime, m.subject, t.ID_TOPIC, t.numReplies, IFNULL(mem.realName, m.posterName) AS realName, IFNULL(lb.logTime, 0) AS boardTime, IFNULL(lmr.logTime, 0) AS markReadTime, IFNULL(mem.ID_MEMBER, -1) AS ID_MEMBER


locate


<a name="b' . $row_board['ID_BOARD'] . '"></a>
<font size="2"><b><a href="' . $scripturl . '?board=' . $row_board['ID_BOARD'] . '">


And immediately insert

<img src="' . $row_board['boardpic'] . '" alt="" border="0">'.


so you should have something like


                     <a name="b' . $row_board['ID_BOARD'] . '"></a>
                     <font size="2"><b><a href="' . $scripturl . '?board=' . $row_board['ID_BOARD'] . '"><img src="' . $row_board['boardpic'] . '" alt="" border="0">'. $row_board['boardName'] . '</a></b><br />
                     ' . $row_board['description'] . '</font>' . $showmods . '
                  </td>


Works a treat for me, but as I say, this is not a mod as I can't help with any tweaks or bugs. This is just me on a learning curve and sharing what I have found/stunmbled across

If it helps anybody else then that's cool with me 8)
;)
Logged
than
Noobie
*
Posts: 22


Re:Adding Images to Boardindex
« Reply #1 on: February 24, 2003, 02:37:13 PM »
Reply with quote

Hi, i´m from spain. Can i see any example of this?

Sorry for my english.

thanks.
Logged
Fizzy
Full Member
***
Posts: 214


Re:Adding Images to Boardindex
« Reply #2 on: February 24, 2003, 08:08:32 PM »
Reply with quote

Hi 'than'

Nothing wrong with your English there mate, it's a heck of a lot better than my Spanish ;)

An example? Sure ....



I guess you could use just about any images that you want as long as the fit inside the boardindex table parameters
Logged
Nemesis
What's an Admin?
Global Moderator
YaBB God
*****
Posts: 2199


WWW
Re:Adding Images to Boardindex
« Reply #3 on: February 25, 2003, 01:55:23 AM »
Reply with quote

Or when you make the descripiton of the board you could use html to add the image there.  ;)
Logged


Want to say thanks?
*************************************
DONATE or check out my WishList
*********************************
than
Noobie
*
Posts: 22


Re:Adding Images to Boardindex
« Reply #4 on: February 26, 2003, 10:04:36 PM »
Reply with quote

Hi, thank´s for the example Fizzy and thank´s for the realy good tip Nemesis.

Bye
Logged
Spaceman-Spiff
Mod Team
YaBB God
*****
Posts: 3689


My $txt[228]

Re:Adding Images to Boardindex
« Reply #5 on: February 26, 2003, 10:22:58 PM »
Reply with quote

Fizzy, u should add [Code] in front of your Subject ;)
for more info, pls read -> http://www.yabbse.org/community/index.php?board=158;action=display;threadid=11961
Logged

   My mods, ysePak, codes, tutorials
    Support question IMs = bad.
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  Adding Images to Boardindex « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.034 seconds with 21 queries.