I am having a bit of an issue trying to update one of my skins I created because a lot of the functions of 2.0 were radically changed in 3.3 and now I no longer find what I'm looking for.
In 2.0, I had been able to add images to the links in account info by hardcoding the images in the file user.php - that wasn't exactly the best deal as far as skin distribution went because that meant this was a change users had to personally do themselves on their own efiction site if they wanted it but... hey it worked for me.
Now though, the issue is that the user.php file no longer have those links because 3.3 uses panels and that each of the links in the user account info are basically panels you enable in the admin section of efiction - right?
So my question is this: How can one add images to those panel links? I definitely didn't think it would work, but I tried adding the image code in the Panel Title, just before the text name... and as I thought, it sure didn't work. I've seen what seems to be the panel output in user.php and that got me to thinking that someone who is PHP/MySQL proficient (something I am not good enough with to do this) could probably do it by going in user.php to find the panel output
if(!$panel['panel_url']) $output .= "<a href=""user.php?action=".$panel['panel_name'"]."">".$panel['panel_title']."</a><br />n";
else $output .= "<a href=""".$panel['panel_url'"]."">".$panel['panel_title']."</a><br />n";
and include a [panel_img] tag in there as long as they tricked the database to allow to enter an image file in the panels admin section... and that's as far as my thinking for me. I'm guessing there is a much simpler way to do this, but I just can't seem to figure it out.
Any help would greatly be appreciated with this because I really liked having my little images and would really like to be able to do that again.
Thanks a lot.
Jacynthe
Archives: http://fanfics.e-authors.net
Version: 3.5.3
Modified? Somewhat...
PHP: 5.3.3
MySQL: 5.0.91-community
You can not add images through the admin area for panels, but you can add then to the panels by adding them to the database manually. I just tried it.
Open the fanfiction_panels table. Only put html in the panel_title part. So it would look something like:
28
editbio
Edit Bio <img src="" http://www.blahblah.gif ">"
1
4
0
U
I don't know if this will have any bad consequences, but it seems to work alright from what I tested. Wherever the panel titles are, however the image will show up as well, and it will be part of the panel link, also underlined if your links are underlined (I'm not sure if the Member Account panels show up anywhere but under account info).
Whoever said nothing is impossible never tried slamming a revolving door.
url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word
Thanks Jan! I never would have thought to try that. Silly me. That was a very big help and hopefully this doesn't have any ill effects on the rest of the install. π
Jacynthe
Archives: http://fanfics.e-authors.net
Version: 3.5.3
Modified? Somewhat...
PHP: 5.3.3
MySQL: 5.0.91-community
hmm funny thing... the images are not showing up for me. Oh well... I'll tinker with that later on. Right now I best get to bed because my 2 weeks vacation are now officially over and I go back to work tomorrow morning. Yuck!
Nevermind I think I had a very blond moment and I probably just discovered what I did wrong.... π
Jacynthe
Archives: http://fanfics.e-authors.net
Version: 3.5.3
Modified? Somewhat...
PHP: 5.3.3
MySQL: 5.0.91-community
Would you mind sending me a screenshot of your user panel after you add all the images? I'm now curious.
Whoever said nothing is impossible never tried slamming a revolving door.
url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word
Hey Jan,
The only real issue with adding the images through the databases is that any and every time you modify one of those panels through the admin console, you have to readd the image to the database cause it obviously takes it away.
Jacynthe
Archives: http://fanfics.e-authors.net
Version: 3.5.3
Modified? Somewhat...
PHP: 5.3.3
MySQL: 5.0.91-community
Ah, neat. π Thanks!
Yeah, but generally you don't edit panels. You set them up and leave them. π
Whoever said nothing is impossible never tried slamming a revolving door.
url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word
Exactly. So your way of doing this was really awesome.
Now I only have a few more icons to come up with and a CSS class to create for the links in the user account menu so I don't necessarily have the underline under the links. Because the line under the images just make everything seem too crowded for me.
Jacynthe
Archives: http://fanfics.e-authors.net
Version: 3.5.3
Modified? Somewhat...
PHP: 5.3.3
MySQL: 5.0.91-community
I'm so proud of myself! I managed to get this done the database way! woo hoo!!!
I'll write complete instructions a little bit later on. I'm not very used to writing SQL queries so I'm still trying to figure out how to write it before I share it with you.
Jacynthe
Archives: http://fanfics.e-authors.net
Version: 3.5.3
Modified? Somewhat...
PHP: 5.3.3
MySQL: 5.0.91-community
1. Go into phpMyAdmin and select your efiction database.
2. Click on Query and enter the following in the SQL query area:
ALTER TABLE 'fanfiction_panels ADD `panel_image` VARCHAR(100) NULL null AFTER `panel_url`;
3. In your efiction files, open user.php
Look for:
if(!$panel['panel_url']) $output .= "<a href=""user.php?action=".$panel['panel_name'"]."">".$panel['panel_title']."</a><br />n";
else $output .= "<a href=""".$panel['panel_url'"]."">".$panel['panel_title']."</a><br />n";
}
replace with:
if(!$panel['panel_url']) $output .= "".$panel['panel_image']." <a href=""user.php?action=".$panel['panel_name'"]."">".$panel['panel_title']."</a><br />n";
else $output .= "".$panel['panel_image']." <a href=""".$panel['panel_url'"]."">".$panel['panel_title']."</a><br />n";
}
4. In your efiction files, open admin/panels.php
Look for:
if(!empty($_GET['edit'])) {
if(!empty($_POST['submit'])) {
$panel_name = addslashes(strip_tags(descript($_POST['panel_name'])));
$panel_title = addslashes(strip_tags(descript($_POST['panel_title'])));
$panel_url = addslashes(strip_tags(descript($_POST['panel_url'])));
$panel_level = (!empty($_POST['panel_level']) && isNumber($_POST['panel_level']) ? $_POST['panel_level'] : 0);
$panel_hidden = (!empty($_POST['panel_hidden']) ? 1 : 0);
$panel_type = strip_tags(descript($_POST['panel_type']));
Replace by:
if(!empty($_GET['edit'])) {
if(!empty($_POST['submit'])) {
$panel_name = addslashes(strip_tags(descript($_POST['panel_name'])));
$panel_title = addslashes(strip_tags(descript($_POST['panel_title'])));
$panel_url = addslashes(strip_tags(descript($_POST['panel_url'])));
$panel_image = addslashes(descript($_POST['panel_image']));
$panel_level = (!empty($_POST['panel_level']) && isNumber($_POST['panel_level']) ? $_POST['panel_level'] : 0);
$panel_hidden = (!empty($_POST['panel_hidden']) ? 1 : 0);
$panel_type = strip_tags(descript($_POST['panel_type']));
then look for:
if($_GET['edit'] != "new") $result = dbquery("UPDATE ".TABLEPREFIX."fanfiction_panels SET panel_name = '$panel_name', panel_title = '$panel_title', panel_url = '$panel_url', panel_level = '$panel_level', panel_hidden = '$panel_hidden', panel_type = '$panel_type'".(!empty($panel_hidden) ? ", panel_order = '$nextorder'" : "")." WHERE panel_id = '".$_GET['edit']."'");
else $result = dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_panels(`panel_name`, `panel_title`, `panel_url`, 'panel_image' `panel_level`, `panel_hidden`, `panel_type`, `panel_order`) VALUES( '$panel_name', '$panel_title', '$panel_url', '$panel_level', '$panel_hidden', '$panel_type', '$nextorder')");
replace with:
if($_GET['edit'] != "new") $result = dbquery("UPDATE ".TABLEPREFIX."fanfiction_panels SET panel_name = '$panel_name', panel_title = '$panel_title', panel_url = '$panel_url', panel_image = '$panel_image', panel_level = '$panel_level', panel_hidden = '$panel_hidden', panel_type = '$panel_type'".(!empty($panel_hidden) ? ", panel_order = '$nextorder'" : "")." WHERE panel_id = '".$_GET['edit']."'");
else $result = dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_panels(`panel_name`, `panel_title`, `panel_url`, 'panel_image' `panel_level`, `panel_hidden`, `panel_type`, `panel_order`) VALUES( '$panel_name', '$panel_title', '$panel_url', '$panel_image', '$panel_level', '$panel_hidden', '$panel_type', '$nextorder')");
Look for:
<label for='panel_url'>"._PANELURL.":</label> <input type='text' class='textbox' name='panel_url' id='panel_url' value='".$panelinfo['panel_url']."'><br />
Add after:
<label for='panel_image'>Panel icon:</label> <input type='text' class='textbox' name='panel_image' id='panel_image' value='".$panelinfo['panel_image']."'><br />
5. Log into your efiction library and move to the admin console. Click on the Panels link and choose the panel you wish to add an image for. In the panel icon field, enter something like this:
<img src=""images/name_of_file.gif"" border="0">
Please note that this location means the images would be in the images folder of your efiction install, not in the images folder of the skins you are using.
And that should be it. I am pretty sure I got all my bases covered...
Jacynthe
Archives: http://fanfics.e-authors.net
Version: 3.5.3
Modified? Somewhat...
PHP: 5.3.3
MySQL: 5.0.91-community
Cool beans! They look great! π
Whoever said nothing is impossible never tried slamming a revolving door.
url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word
Thank you Jan! π
It's such a great thing to have a test library... am getting all the kinks worked out so that I can hopefully do this very painlessly once it's time to update the live install.
Now if only I could get my random quote thingie to work. I mean I had a very simple one that worked great but I'm looking to implement the quote4me script inside my skins because there are just too many otherwise! The darn thing I don't get is that it DOES call the file correctly but the info is just not showing once parsed into the template. it's like... it's not finding the text file maybe? *scratches head*
Anyways.... one hurdle down... 25 to go!
Jacynthe
Archives: http://fanfics.e-authors.net
Version: 3.5.3
Modified? Somewhat...
PHP: 5.3.3
MySQL: 5.0.91-community
thanks Im going to add this to my test site soon, just a quick question would this work for efiction 3.2.1 too as my main site uses that right now
~Spikey~
my site url: http://www.fanfictionworld.org
efic version:3.5.3
I don't know if there has been a big change in the coding between 3.2.1 and 3.3 as I totally bypassed the whole 3.0 and up... But I'm sure Tammy or Carissa or someone who's very intimate with the coding would be able to tell you.
My first guess would be that it would work... but my word is not gold. π
Jacynthe
Archives: http://fanfics.e-authors.net
Version: 3.5.3
Modified? Somewhat...
PHP: 5.3.3
MySQL: 5.0.91-community

