What's wrong with this
x-Treme Offline
Member
***
Posts: 68
Joined: May 2010
Post: #1
What's wrong with this
I changed the postbit_find button so when clicked, it opens a popup to choose user's posts or threads (much the same way as clicking the edit button and choosing quick or full edit). I thought it was working great, but just noticed it only works on the first two posts of a thread. Anyone know what I am doing wrong?

Here is the code i am using for postbit_find:

Code:
1
2
3
4
5
6
7
8
9
10
<a href="search.php?action=finduser&amp;uid={$post['uid']}" id="find" style="text-decoration:none;"><img src="{$theme['imglangdir']}/postbit_find.gif" alt="{$lang->postbit_find}" title="{$lang->postbit_find}" /></a>
<div id="find_popup" class="popup_menu" style="display: none;"><div class="popup_item_container"><a href="search.php?action=finduserthreads&amp;uid={$post['uid']}" class="popup_item">Find All Threads</a></div><div class="popup_item_container"><a href="search.php?action=finduser&amp;uid={$post['uid']}" class="popup_item">Find All Posts</a></div></div>
<script type="text/javascript">
// <!--
    if(use_xmlhttprequest == "1")
    {
        new PopupMenu("find");
    }
// -->
</script>


nvm...I see my mistake now

Forum Freebies
(This post was last modified: 02-21-2012 05:26 AM by x-Treme.)
02-21-2012 05:12 AM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #2
RE: What's wrong with this
If I read right your code, you need to make all javascript with a unique ID, so that it will work in all posts.

I think were it says:

Code:
new PopupMenu("find");


and:

Code:
id="find"


It should be:

Code:
new PopupMenu("find{$post['pid']}");


and:

Code:
id="find{$post['pid']}"


That will make it unique for each post.


Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
02-21-2012 11:27 AM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: