Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: how to pull current url in theme.php  (Read 4174 times)

0 Members and 1 Guest are viewing this topic.

metal13

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
how to pull current url in theme.php
« 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 ..... :-[
Logged

metal13

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: how to pull current url in theme.php
« Reply #1 on: August 18, 2013, 09:34:14 am »

anyone? i really need this..  :(
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: how to pull current url in theme.php
« Reply #2 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.
Logged

metal13

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: how to pull current url in theme.php
« Reply #3 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..
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: how to pull current url in theme.php
« Reply #4 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.
Logged

metal13

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: how to pull current url in theme.php
« Reply #5 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..
Logged

metal13

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: how to pull current url in theme.php
« Reply #6 on: August 22, 2013, 10:59:38 am »

http://forum.coppermine-gallery.net/index.php/topic,65579.msg326203.html#msg326203
Best code i found..
Code: [Select]
{$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

Code: [Select]
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}
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: how to pull current url in theme.php
« Reply #7 on: August 22, 2013, 11:01:16 am »

To get the picture ID, try
Code: [Select]
$superCage->get->getInt('pid');
Logged

metal13

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: how to pull current url in theme.php
« Reply #8 on: August 22, 2013, 01:50:00 pm »

Like this? i tried to change the code and place but none worked
Code: [Select]
{$CONFIG['site_url']}displayimage.php?pid=$superCage->get->getInt('pid');
i got this on the live site btw..
[site]displayimage.php?pid=->getInt('pid');
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: how to pull current url in theme.php
« Reply #9 on: August 22, 2013, 05:00:31 pm »

You cannot embed into an EOT block. Instead, add something like
Code: [Select]
$pid = $superCage->get->getInt('pid');above it and then use
Code: [Select]
{$CONFIG['site_url']}displayimage.php?pid={$pid}
Logged
Pages: [1]   Go Up
 

Page created in 0.025 seconds with 20 queries.