Getting facebox to work in the qcodo/qcube php framework - php

I am using a framework called qcodo (which forked as qcubed) and is a PHP framework.
I want to do a very simple popup using the Facebox jquery plugin.
When someone clicks on the link and shown below in line 47.
Here is the file: http://github.com/allyforce/AF-upload/blob/master/Templates/profile_activity.tpl.php
<a href="complete_profile_popup.php?allyId=<?= $this->objAllyUser->Id?>" rel="facebox" title="Complete Profile" >Invite as Ally</a><br />
The Facebook installation worked fine, tested it just opening plain html and php files.
I just want to be able to render a working page within the Facebox pop-up.
But the current error is that it cannot recognize the method, even though it appears it has been defined.
UPDATE: Per one suggestion, used iFrame, but still getting nothing:

You should print the error you get. I will try to guess: have you declared your method as public? In the template you can access only public properties and methods. This is a very common mistake.

This issue/topic is being discussed in depth at http://www.qcodo.com/forums/forum.php/3/4007/

Related

Replacing HTML tooltip content with PHP/jQuery

So, I have that WordPress website on which I installed a template (Zoo). My problem is that I want the whole site to be in French, and there are three buttons in that template which title tag is coded deep in a js file that is inside a plugin which has been integrated to the template.
These are my first steps as a web developer (I come from C++) and I'm having quite a hard time understanding what is missing in the files, but I understood a few things by looking around.
So I made a child theme. This is the functions.php file. I think it works fine, but here it is in case I am doing it wrong :
<?php
function removethosedamntooltips(){
wp_register_script('removetooltips', get_stylesheet_directory_uri() . '/js/removetooltips.js');
wp_enqueue_script( 'removetooltips' );
}
add_action('wp_enqueue_scripts', 'removethosedamntooltips');
This is the aforementioned removetooltips.js file. I believe I have to call for a button hover because the template is single-page parallax and the buttons I want to modify are not visible until you click another button which allows for another display without sending the browser to another URL (if I remove line 2 and the closing brackets that go with it, it doesn't work anyway). Also, those tooltips appear only on mouse hover, so it seems a good idea :
jQuery(document).ready(function(){
alert("jQuery!!");
jQuery("button").hover(function(){
alert("jQuery!!");
jQuery(".mfp-arrow-left").attr("title", "Précédent (flèche gauche)");
jQuery(".mfp-arrow-right").attr("title", "Suivant (flèche droite)");
jQuery(".mfp-close").attr("title", "Fermer (Esc)");
});
});
The first alert displays after the page is loaded, but the second one does not show up. The tooltips (button title) still show up in English.
A piece of information that might be useful to solve this problem (I'm only 2 days into reading stuff about JavaScript and jQuery so I don't really know): I had to use jQuery instead of $ or the console would tell me that $ is an unknown function. Do I need to somehow include the jQuery framework in my file (if so, where and how ?), although a calling for the jQuery library already shows up in the header ?
If you provide a solution that will remove the tooltips instead of replacing their content, I will be happy enough.
Thank you in advance !
Instead of using
jQuery("button").hover(function(){...});
You should find the container in which all buttons are placed or just use body
and use jquery .on() method. As far as I know it'll work.
so your complete code will be like this
jQuery(document).ready(function(){
alert("jQuery!!");
jQuery("body").on("hover", "button", function(){
jQuery(".mfp-arrow-left").attr("title", "Précédent (flèche gauche)");
jQuery(".mfp-arrow-right").attr("title", "Suivant (flèche droite)");
jQuery(".mfp-close").attr("title", "Fermer (Esc)");
});
});
Explanation:
Using .on() method binds the event with dynamically created elements too. As you mentioned in your question that buttons are not created until another button/link is clicked.
Edit: Tested this one and its working. I've removed the second alert because with that you won't be able to test.

how can I make a page opening only into the iframe and not if it's called directly?

The content generate by list.php should be only opened into an iframe tag, on the index.php. But when it's called directly, it should not be possible to open it.
How can I obtain this?
In fact I already adopete this method:
<iframe title="frame" class="iframe" src="http://www.example.com/list.php?type=a&013acd2b6c1368f">[Your browser doesn%27;t support iframes]</iframe>
which works fine, thus if the file is called without the arguments ,it redirects to the index.
BUT if you call it directly in this way http://www.example.com/list.php?type=a&013acd2b6c1368f the content appears at full page. While I want that, being outside the tag , it redirects to Index.php
Is there any way please?
I'm sorry to any one.
After have written this message, I finally found the answer here and with small adaption it worked out perfectly.
I didn't find this post before.
Answer to my question

Isotope not responding to class name

I have a class that works with isotope.
The trigger class is loaded through jquery from a PHP file and is therefore not loaded right away.
I can see the class in the DOM, but not in the source code.
Should this stop it from working all together?
I am not sure what code I can post in relation to this, because it is a huge project and the content of the php loads fine through the jquery call, but the isotope does not work when I do it this way.
To clarify if I load it in the html file directly, the isotope works. So that is confirmed.
It only stops working when it loaded from the PHP file, however it is still displaying all the divs.
Any ideas?
========
added binding code
<li>All</li>
<li>Chair</li>
<li>Secretary</li>
<li>Treasurer</li>
<li>Admin</li>
Thanks :-)
It works now
I had to change
$('#menu-items').html(msg);
into this:
$('#menu-items').html(msg);
$('#menu-items').isotope('reloadItems');

What could cause something like that ? PHP - MYSQL failure

Firstly i want to explain how my script works..
I'am using script named TSUE and source code protect by ioncube. Script has own plugins system kind of like vbulletin's Addons system. For using this system i need to create new php function to get data from database and i need to create a template for use(show) them as i want.
I created very simple plugin sample code. I'm getting tid and added coloum in tsue_torrents table with this function;
and using by this template i can show this data which page i want!
here is template
(template name is example btw. need to call that template using by eval in function)
<div class="widget">
<h4>Plugins Example</h4>
<br />
{$output}
</div>
Everything is look fine
But when i add this plugins on my main page or anypage of script I getting error like this;
��\IsG�>��%x!��n�(.���d)D�94��]J��]�$A����4a}�.sҍ��z_VU/ #��/��#-�YYY�U�w��|������~�ܦ�Lz���ѷk����SK�z��н� �ч�v)7�q�m"���u�c&O:�$B�����Nm���œ �m6OOO<!І�/rP�V�5��f�� �s%�#;�� �4MT*S_t���=�����n������˷��7��D�Lw���4S�l�w�%#u��� Ⱥ/����p?�S�s�]�?o �c_�=�~*�u4�]��/*�'B-<[�<�T�ϓ�J'S`�>w�*?s���/�1K�ߩ�9j$:_��F<���O:��g~G79��~t���1��8�|��$��b?��H�T����L:)pq�C���P�4����Ӑ�+G|(zC�C�&�8�:�����9je)!����$�1�)�g1��p�B���̐g!-��N���D*' �Q*�o5�NJ<'%Ha��v,#A_$<���φ2��F�z.O�0J$��&.k,����6]�M�'9��&B#��*�4���Yʾ�Q�i� ���A�P��yV�n��ݴ��tJ?�&8�mO�h�3�ד(Jk�h��iVY��8v��Ô��k��Gˌ����B���b�5�"}��g��c>��vU�}���.l�:h��� `k��4KB=Ȃo�K 0QCz##=;���k�& 7m�+�Q4n�"m�I��E��x�>>�zNO���Ta�M䉆�H�}��v9k�Ӫ���a+�+��#��R����=h7-�H�����R�S�3�a���O�zݨʜ�Ԩu�Ғ��ԮL�mI>i��#�n��f��Juj�=_��0<��zyj�U�9�Z�k�y��H��J�0>����'8L�Z?K�(��QF�B7�������E�uB:�$�i����m�hV�F��AHU�փ� �,�!��wjZ�U��6�pH8y��#OOe� c��5C��\�ɼ :�.���Q]$�lm����%��I�=� ���C��Р��#O�89Pk5����M����f�]_�cc
Screenshot :
Okay; I found why i get that weird error.
I think it is because Dreamweaver CS6.. I don't know excatly reason but when i type my code another php editor , function work fine..

custom php function to call in header

I have a Wordpress website. I am asking for help as I am not good with codes, but know a bit about the flow of functions and all.
I want to add a new PHP function that will be defined in a separate file. The function to be defined is required to serve a 728x90 banner ad on top of the header area of the site (so I guess the php function will also have CSS styling to align the ad in the center). I don't know what I am saying will be possible the way I am saying.
Alternatively, there might be a way to call a js function defined in separate file, then called in the php header to serve the banner (again center-aligned).
I am seeking help here as Stackoverflow also helped me solve problems previously.
Is there anyone who can help me get this thing done?
Once you have your PHP handler written in a separate file call it using require_once like this:
<?php
require_once('myfile.php');
// Wordpress Stuff
?>
I guess PHP have no relation with CSS/styling, you can do it with Javascript.
like this or using JQuery

Categories