Replace Board Title With Image

Started by dougiefresh, November 29, 2017, 05:04:09 PM

Previous topic - Next topic

lather

Quote from: shadav on January 25, 2021, 10:53:18 AM
Quote from: lather on January 23, 2021, 03:21:54 PM
I successfully installed this mod on my 2.0.15 forum but am  have not been able to make it work. I have uploaded a test image to Themes/default/images and enter that url but nothing happens. No error message but nothing changes on the board.
When you installed the mod was there any errors on the install page?
are you using a custom theme? if you switch to default theme does it work?
this shouldn't really be an issue with this mod but can't hurt....

make sure that the image was uploaded....go to the images url and make sure that it is there and viewable....
are you using cache? clear your cache then reload the page.....clear your browsers cache and reload the page....

use the parse on the mod page and make sure that all edits were made
Thanks for your reply. There were no errors on install of the mod. The current theme is SMF Default Theme - Curve
I uploaded the image with ftp to /public_html/mstaforums/Themes/default/images and can view it with FTP client.
I have not cleared caches I will try that.  I will also check the edits. Thanks again.

lather

I have cleared caches fro the forum and my browser, no luck.
I verified the edits to all these files:
./Themes/default/ManageBoards.template.php
./Themes/default/languages/ManageBoards.english.php
/Sources/Subs-Boards.php
./Sources/Subs-BoardIndex.php
./Sources/ManageBoards.php
The only missing is
ManageBoards.spanish_latin.php we do noy have that file but should not make any difference

I looked at the SMF_boards table in the database and the  3 image fields are there but img _name is blank and width and height are 0


lather

I still can't get this to work, I must be missing something obvious. Any more suggestions?

shadav

does it replace the board title but just with a blank space or is the board title still there?

lather

The board title is still there. When I return to the mod and try again the title field is blank.
In other words the path and image file name I previously enter is not there.

Tonyvic

You are scrolling down and selecting the 'Modify' button after entering the url?


shadav

did you use the package manager to install this mod or did you manually install it?
if manually, did you upload the file db_install.php to your site and the run it by going to yoursite url/db_install.php

lather


shadav

if you want to pm me the url, access to ftp and an admin account
I'll try to take a look and see if I can find anything....

lather

Thank you for that kind offer. I will need to get our club president approval.

lather

I finally got the mod to work. :) I had been  selecting default theme since when I look at current theme in admin is shows: SMF Default Theme - Curve
This time I tried "core" and it worked. Thanks again for all your help.

shadav

not sure I understand, you uploaded the file to the core theme instead of the default theme?

Anyways glad you got it sorted it :)

what I did was created a new folder in the main forum's folder (where the Settings.php file is)
I'm lazy at names so I just named this new folder, replaceboardname
that way the images aren't theme dependent
and then just call the image as
/replaceboardname/IMAGENAME.EXTENTION

lather

Quote from: shadav on February 02, 2021, 02:53:54 PM
not sure I understand, you uploaded the file to the core theme instead of the default theme?

Anyways glad you got it sorted it :)

what I did was created a new folder in the main forum's folder (where the Settings.php file is)
I'm lazy at names so I just named this new folder, replaceboardname
that way the images aren't theme dependent
and then just call the image as
/replaceboardname/IMAGENAME.EXTENTION
This is what about drove me crazy (admittedly a short trip) To get it to work the image had to be in /public_html/mstaforums/Themes/default/images but when modifying the board I had to select core theme from the pull down. I think the previous admin who set up the forum messed up our themes some way, I don't know... see attachment.  Anyway your solution sounds much better, thanks!

shadav

yeah that's not right....something some where's off

also don't forget to add the / in front
if you try to use it in a sub board it won't work unless you put the / before
/Themes/default/images/IMAGENAME

otherwise it tries to pull the image from forum/sub-board/themes/default/images/IMAGENAME

Dave J

Is there any chance of this being updated to SMF2.1.1 please?
If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

lather


Grammy

I got this to work in 2.1.2 by manually installing it, after seeing that it failed emulation.

In Sources/Subs-BoardIndex.php, I had to find
        'b.name AS board_name',
        'b.description',
  and add after
        'b.img_name',
        'b.img_width',
        'b.img_height',

and in Sources/Subs-Boards.php I had to find
global $cat_tree, $boards, $smcFunc  and add after
, $boarddir, $sourcedir,
(I had to add $sourcedir, because otherwise, it threw an Unknown Variable: $sourcedir error for that file.)

All the other file edits in the manual installation for 2.1 were fine, only Sources/Subs-BoardIndex.php and Sources/Subs-Boards.php were problematic.  (And I had to remember to add the language file edits.)

The db_install.php file worked with no issue and the image appears just as it should, with no log errors...  for me, anyway.

(I'm only posting this because someone asked and since I kick tires and test things, I tried it and it works fine, no errors, and the images appears as it should. 

O:)

Grammy

Well....  okay, all good except for an error I didn't discover until I tried to create a new board: 
Undefined index: image
That's coming from ManageBoards.template.php, line 347:
   
<input type="text" name="board_image" value="', $context['board']['image']['name'], '" size="30" class="input_text" />

Does this require an "isset" statement?  (Like I even know what I'm asking...)  :-\


 :D

Grammy

Quote from: Grammy on August 09, 2022, 12:13:08 PMWell....  okay, all good except for an error I didn't discover until I tried to create a new board: 
Undefined index: image
That's coming from ManageBoards.template.php, line 347:
   
<input type="text" name="board_image" value="', $context['board']['image']['name'], '" size="30" class="input_text" />

Does this require an "isset" statement?  (Like I even know what I'm asking...)  :-\


 :D

Never mind, I sorted it. 

   
<input type="text" name="board_image" value="', $context['board']['image']['name'], '" size="30" class="input_text" />

is now this:

    <input type="text" name="board_image" value="' . $verify_context = &$context['board']['image']['name'], '" size="30" class="input_text" />
An old SMF friend of mine used to call this "Duct Tape".  :D


Advertisement: