coppermine-gallery.com/forum

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: metal13 on August 17, 2013, 11:05:47 AM

Title: how to pull current url in theme.php
Post by: metal13 on August 17, 2013, 11:05:47 AM
i want to add Facebook comments on my images but i cant find the code for current url... i did search btw but none worked.. tried the social sharing plugin too but i cant reposition it to where i want..
code for current image id would also do the trick..

i think its in the rules to post your gallery's url first before you get any support but mine is NSFW..   ;D ..... :-[
Title: Re: how to pull current url in theme.php
Post by: metal13 on August 18, 2013, 09:34:14 AM
anyone? i really need this..  :(
Title: Re: how to pull current url in theme.php
Post by: Αndré on August 21, 2013, 12:01:57 PM
Depending on where you added your current Facebook code, the approach is different. So please post what you've done so far and where.
Title: Re: how to pull current url in theme.php
Post by: metal13 on August 22, 2013, 04:50:52 AM
its on the image itself..
i got it to display
[site]displayimage.php?pid=[ but no image number ]

i deleted the code because it wasn't working.. so i cant really post it..
all i need is the image number code to showup on the comment section..
Title: Re: how to pull current url in theme.php
Post by: Αndré on August 22, 2013, 09:23:33 AM
As there are already several threads and even ready mods and plugins, I suggest to have a look at them again. I don't want to start from scratch if possible.
Title: Re: how to pull current url in theme.php
Post by: metal13 on August 22, 2013, 10:49:04 AM
I always search before i post.. i didnt find any code that works..
anyways ill search again and post it here maybe you could help me make it work..
Title: Re: how to pull current url in theme.php
Post by: metal13 on August 22, 2013, 10:59:38 AM
http://forum.coppermine-gallery.net/index.php/topic,65579.msg326203.html#msg326203
Best code i found..
{$CONFIG['site_url']}displayimage.php?pid={$CURRENT_PIC_DATA['pid']}


i tried that but the "pid" doesn't work..



this is my comment code in theme.php

if (!isset($template_add_your_comment)) { //{THEMES}
/******************************************************************************
** Section <<<$template_add_your_comment>>> - START
******************************************************************************/
$template_add_your_comment = <<<EOT
aaaaaaaaaaaaaaaaaaaaaaaaa
<div class="forabg" style="margin-right: 1px;">
  <div class="inner"> <span class="corners-top"><span></span></span>
<ul class="topiclist">
  <li class="header">
<dl class="icon">
          <dt style="width: 100%;">&nbsp;</dt>
        </dl>
      </li>
    </ul>
<ul class="topiclist forums">
<li class="row bg1">
<dl class="icon">
          <dd style="width: 100%;">
         
        <form method="post" name="post" id="post" action="db_input.php">
                <table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
                        <tr>
                                        <td width="100%" class="tableh2">{ADD_YOUR_COMMENT}{HELP_ICON}</td>
                        </tr>
                        <tr>
                <td colspan="1">
                        <table width="100%" cellpadding="0" cellspacing="0">

<!-- BEGIN user_name_input -->
                                                        <tr>
                               <td>
                                        {NAME}
                                </td>
                                <td>
                                        <input type="text" class="textinput" name="msg_author" size="10" maxlength="20" value="{USER_NAME}" onclick="if (this.value == '{DEFAULT_USERNAME}') this.value = '';" onkeyup="if (this.value == '{DEFAULT_USERNAME}') this.value = '';" />
                                </td>
<!-- END user_name_input -->
<!-- BEGIN input_box_smilies -->
                                <td>
                                {COMMENT}
                                </td>
                                <td width="100%">
                                <input type="text" class="textinput" id="message" name="msg_body" onselect="storeCaret_post(this);" onclick="storeCaret_post(this);" onkeyup="storeCaret_post(this);" maxlength="{MAX_COM_LENGTH}" style="width: 100%;" />
                                </td>
<!-- END input_box_smilies -->
<!-- BEGIN input_box_no_smilies -->
                                <td>
                                {COMMENT}
                                </td>
                                <td width="100%">
                                <input type="text" class="textinput" id="message" name="msg_body"  maxlength="{MAX_COM_LENGTH}" style="width: 100%;" />
                                </td>
<!-- END input_box_no_smilies -->
<!-- BEGIN submit -->
                                <td>
                                <input type="hidden" name="event" value="comment" />
                                <input type="hidden" name="pid" value="{PIC_ID}" />
                                <button type="submit" class="button" name="submit" value="{OK}"  onclick="return notDefaultUsername(this.form, '{DEFAULT_USERNAME}', '{DEFAULT_USERNAME_MESSAGE}');">{OK_ICON}{OK}</button>
                                <input type="hidden" name="form_token" value="{FORM_TOKEN}" />
                                <input type="hidden" name="timestamp" value="{TIMESTAMP}" />
                                </td>
<!-- END submit -->
                                                        </tr>
<!-- BEGIN comment_captcha -->
                                                        <tr>
                                <td colspan="2">
                                  {CONFIRM}
                                </td>
                                <td colspan="2">
                                  <input type="text" name="confirmCode" size="5" maxlength="5" class="textinput" />
                                  <img src="captcha.php" align="middle" border="0" alt="" />
                                </td>
                                                        </tr>
<!-- END comment_captcha -->
                        </table>
                </td>
        </tr>
<!-- BEGIN smilies -->
        <tr>
                <td width="100%">
                        {SMILIES}
                </td>
        </tr>
<!-- END smilies -->
<!-- BEGIN login_to_comment -->
        <tr>
                                <td colspan="2">
                                  {LOGIN_TO_COMMENT}
                                </td>
        </tr>
<!-- END login_to_comment -->
                </table>
        </form>
         
  </dd>
        </dl>
      </li>
    </ul>
    <span class="corners-bottom"><span></span></span> </div>
</div>
       
EOT;
/******************************************************************************
** Section <<<$template_add_your_comment>>> - END
******************************************************************************/
} //{THEMES}
Title: Re: how to pull current url in theme.php
Post by: Αndré on August 22, 2013, 11:01:16 AM
To get the picture ID, try
$superCage->get->getInt('pid');
Title: Re: how to pull current url in theme.php
Post by: metal13 on August 22, 2013, 01:50:00 PM
Like this? i tried to change the code and place but none worked
{$CONFIG['site_url']}displayimage.php?pid=$superCage->get->getInt('pid');

i got this on the live site btw..
[site]displayimage.php?pid=->getInt('pid');
Title: Re: how to pull current url in theme.php
Post by: Αndré on August 22, 2013, 05:00:31 PM
You cannot embed into an EOT block. Instead, add something like
$pid = $superCage->get->getInt('pid');
above it and then use
{$CONFIG['site_url']}displayimage.php?pid={$pid}