(28-Feb-2014, 09:01 PM)Steven Wrote: Hi,
Can you paste here the code that you copied?
Apologies for the delay in replying. I have cancer, the treatment for which takes up a lot of my time!). Anyway, I'm not a programmer (my website works despite my best efforts, not because of them!).
Here is the address of a page that includes comments (near the bottom of the page) ...
http://mfo.me.uk/getperson.php?personID=I1&tree=E1
... and here is one that doesn't...
http://mfo.me.uk/getperson.php?personID=I3&tree=E1
The code that I copied (and please remember that I really don't know what I'm doing) is the following:
Code:
/* *** Social *** */
echo "<div class='cmtx_social_block'>";
if (cmtx_setting('show_social')) {
$cmtx_social_url = cmtx_url_encode_spaces(cmtx_get_page_url());
$cmtx_social_title = cmtx_url_encode_spaces(cmtx_get_page_reference());
$cmtx_social_url = str_ireplace("&", "%26", $cmtx_social_url); //convert & to %26
$cmtx_social_title = str_ireplace("&", "%26", $cmtx_social_title); //convert & to %26
$cmtx_social_attribute = ""; //initialize variable
if (cmtx_setting('social_new_window')) {
$cmtx_social_attribute = " target='_blank'";
}
echo "<div class='cmtx_social_images'>";
if (cmtx_setting('show_social_facebook')) {
echo "<a href='http://www.facebook.com/sharer.php?u=" . $cmtx_social_url . "&t=" . $cmtx_social_title . "' rel='nofollow'$cmtx_social_attribute><img src='" . cmtx_comments_folder() . "images/social/facebook.png' class='cmtx_social_image' title='Facebook' alt='Facebook'/></a>";
}
if (cmtx_setting('show_social_delicious')) {
echo "<a href='http://delicious.com/post?url=" . $cmtx_social_url . "&title=" . $cmtx_social_title . "' rel='nofollow'$cmtx_social_attribute><img src='" . cmtx_comments_folder() . "images/social/delicious.png' class='cmtx_social_image' title='del.icio.us' alt='del.icio.us'/></a>";
}
if (cmtx_setting('show_social_stumbleupon')) {
echo "<a href='http://www.stumbleupon.com/submit?url=" . $cmtx_social_url . "&title=" . $cmtx_social_title . "' rel='nofollow'$cmtx_social_attribute><img src='" . cmtx_comments_folder() . "images/social/stumbleupon.png' class='cmtx_social_image' title='StumbleUpon' alt='StumbleUpon'/></a>";
}
if (cmtx_setting('show_social_digg')) {
echo "<a href='http://digg.com/submit?phase=2&url=" . $cmtx_social_url . "&title=" . $cmtx_social_title . "' rel='nofollow'$cmtx_social_attribute><img src='" . cmtx_comments_folder() . "images/social/digg.png' class='cmtx_social_image' title='Digg' alt='Digg'/></a>";
}
if (cmtx_setting('show_social_technorati')) {
echo "<a href='http://technorati.com/faves?add=" . $cmtx_social_url . "' rel='nofollow'$cmtx_social_attribute><img src='" . cmtx_comments_folder() . "images/social/technorati.png' class='cmtx_social_image' title='Technorati' alt='Technorati'/></a>";
}
if (cmtx_setting('show_social_google')) {
echo "<a href='https://plus.google.com/share?url=" . $cmtx_social_url . "' rel='nofollow'$cmtx_social_attribute><img src='" . cmtx_comments_folder() . "images/social/google.png' class='cmtx_social_image' title='Google+' alt='Google+'/></a>";
}
if (cmtx_setting('show_social_reddit')) {
echo "<a href='http://reddit.com/submit?url=" . $cmtx_social_url . "&title=" . $cmtx_social_title . "' rel='nofollow'$cmtx_social_attribute><img src='" . cmtx_comments_folder() . "images/social/reddit.png' class='cmtx_social_image' title='Reddit' alt='Reddit'/></a>";
}
if (cmtx_setting('show_social_myspace')) {
echo "<a href='http://www.myspace.com/Modules/PostTo/Pages/?u=" . $cmtx_social_url . "&t=" . $cmtx_social_title . "' rel='nofollow'$cmtx_social_attribute><img src='" . cmtx_comments_folder() . "images/social/myspace.png' class='cmtx_social_image' title='MySpace' alt='MySpace'/></a>";
}
if (cmtx_setting('show_social_twitter')) {
echo "<a href='http://twitter.com/home?status=" . $cmtx_social_title . "%20-%20" . $cmtx_social_url . "' rel='nofollow'$cmtx_social_attribute><img src='" . cmtx_comments_folder() . "images/social/twitter.png' class='cmtx_social_image' title='Twitter' alt='Twitter'/></a>";
}
if (cmtx_setting('show_social_linkedin')) {
echo "<a href='http://www.linkedin.com/shareArticle?mini=true&url=" . $cmtx_social_url . "&title=" . $cmtx_social_title . "' rel='nofollow'$cmtx_social_attribute><img src='" . cmtx_comments_folder() . "images/social/linkedin.png' class='cmtx_social_image' title='LinkedIn' alt='LinkedIn'/></a>";
}
echo "</div>";
}
echo "</div>";
echo "<div style='clear: both;'></div>";
I dropped this in after line 325 following this line...
Code:
if ($cmtx_number_of_comments == 0) { //if no comments
It now seems to work but I'd certainly appreciate it is you would take a look at make sure I havent done something that I might regret later
. This really is beyond my capabilities so thanks in advance for any thoughts you might have. If you say it's too difficult, that's good enough for me.
(PS., I've attached a copy of the file as it is modified by me.)
Thanks
Roger