Discussion
Captions not appearing(back to index)hi, I posted my pictures via index.php/post, and entered a caption. I also inserted <#fbcaption#> where I wanted my caption to appear in template_main.php.
However it does not appear. What have I done wrong? Thank you.
posted by
Muffin on 8 Jul 05 at 1:33 PM
Muffin, do you get any error messages? What is your $captions_directory set to?
posted by
donald on 8 Jul 05 at 2:55 PM
I don't get any error message.
I set it to 'pcaptions'. The directory is empty.
posted by
Muffin on 9 Jul 05 at 12:49 AM
Muffin, my only two suggestions would be to ensure that you included the trailing slash ($captions_directory = "pcaptions
/";) and making sure you've set the permissions on the directory to at least 755.
I looked over the code again, but can't see anything that should cause problems.
posted by
donald on 9 Jul 05 at 1:55 AM
My template_settings.php has no <#fbcaption#> listed. Could that be the reason?
posted by
Muffin on 9 Jul 05 at 2:37 AM
It also has no <#fbdate#> listed. (my date also does not appear)
posted by
Muffin on 9 Jul 05 at 2:40 AM
Nope. The tagging seems to be fine, it's just an issue of getting the captions to post. Not sure why it's not working, as commenting seems to be doing okay.
posted by
donald on 9 Jul 05 at 3:24 AM
Try creating a PHP file with this content and putting it in your folderblog directory:
<?php
$file = fopen("pcaptions/blah.txt");
fwrite("folder\nblog");
fclose($file);
?>
This should create a file called "blah.txt" in your captions folder. Let me know if it works.
posted by
donald on 9 Jul 05 at 3:27 AM
I created a new php file (is this right?) called create.php. It's here: http://nadyne.moved.in/create.php
Error messages:
Warning: fopen() expects at least 2 parameters, 1 given in /home/nadyne/public_html/create.php on line 2
Warning: Wrong parameter count for fwrite() in /home/nadyne/public_html/create.php on line 3
Warning: fclose(): supplied argument is not a valid stream resource in /home/nadyne/public_html/create.php on line 4
blah.txt was not created.
posted by
Muffin on 9 Jul 05 at 3:44 AM
Whoops, I messed that one up. Replace the old create.php content with:
<?php
$file = fopen("pcaptions/blah.txt", "w");
fwrite($file, "folder\nblog");
fclose($file);
?>
Sorry for the trouble.
posted by
donald on 9 Jul 05 at 3:53 AM
Yey blah.txt was created. But, my captions don't appear still.... :(
posted by
Muffin on 9 Jul 05 at 3:56 AM
Muffin, I'm just trying to diagnose the problem — we'll work it out.
Can you add the following code to the very start of your template_main.php?
<?php
if ((get("doPost"))) {
echo "$captions_directory$image.txt<br />'";
echo "{$_POST["title"]} ($title)'<br />'";
echo "{$_POST["caption"]} ($caption)'<br />";
}
?>After you've done that and saved it, attempt to post a caption and then copy/paste the output here.
posted by
donald on 9 Jul 05 at 4:04 AM
I did that. No error messages; the picture uploaded appeared, but without the caption.
Contents of blah.txt:
folder
blog
posted by
Muffin on 9 Jul 05 at 6:01 AM
hi donald, thanks alot for being helpful.
I tried something. I uploaded a freshly downloaded version (straight from folderblog website) of template_main.php and uploaded it. Now there is an error message:
Notice: Undefined variable: emptylink in /home/nadyne/public_html/index.php(493) : eval()'d codeon line 21
Notice: Undefined variable: emptylink in /home/nadyne/public_html/index.php(493) : eval()'d codeon line 22
posted by
Muffin on 9 Jul 05 at 6:06 AM
Muffin, you need to add the $emptylink variable (and a couple others) to your fb_settings.php with the newest version.
You can't upload a new file and post a caption in the same action — can you try just adding a caption to one of your images and paste the output from the abvoe post? It should spit out a few lines of text right at the top of your file.
posted by
donald on 9 Jul 05 at 11:58 AM
Doesn't work. Last night I downloaded fb3b15 and uploaded those files, replacing my template and css styles, everything. Yet the caption does not appear, even with these default templates.
posted by
Muffin on 10 Jul 05 at 1:45 AM
Muffin, is there any output from the above code (if you add it to the start of your template files)?
posted by
donald on 10 Jul 05 at 3:35 AM
I inserted <?php
if ((get("doPost"))) {
echo "$captions_directory$image.txt
echo "{$_POST["title"]} ($title)'
'";
echo "{$_POST["caption"]} ($caption)'
";
}
?>
at the very beginning of template_main.php, but it does not seem to have any effect - no output, nor error messages.
posted by
Muffin on 10 Jul 05 at 4:22 AM
Donald, is this what you mean...
I ran this:
http://nadyne.moved.in/template_main.php
Message:
Fatal error: Call to undefined function: get() in /home/nadyne/public_html/template_main.php on line 2
posted by
Muffin on 10 Jul 05 at 4:24 AM
Muffin, try to post a new caption via the /post/ page — there should be a few lines of text that show up at the top of your page immediately after you've posted.
posted by
donald on 10 Jul 05 at 4:55 AM
Nope, I posted a new picture with a caption, but once posted, the page refreshes to show the image that was uploaded. Caption not found, no lines of text anywhere.
posted by
Muffin on 10 Jul 05 at 5:48 AM
Muffin, you can't upload a new picture and edit a caption at the same time. Try just updating the caption of an existing image without uploading any image.
posted by
donald on 10 Jul 05 at 8:17 AM
hey it works. thanks so so so much donald!
I didn't know I couldn't upload a new picture and edit caption at the same time. *sheepish*
posted by
Muffin on 10 Jul 05 at 9:13 AM
No worries. It's a bit counter-intuitive, but it's the best system I could come up with. I really need to write better documentation.
posted by
donald on 10 Jul 05 at 6:16 PM
Post a Reply:
(back to index)