Jump to content

Jyoti Rani

Clients
  • Posts

    76
  • Joined

  • Last visited

 Content Type 

Downloads

Release Notes

IPS4 Guides

IPS4 Developer Documentation

Invision Community Blog

Development Blog

Deprecation Tracker

Providers Directory

Forums

Events

Store

Gallery

Posts posted by Jyoti Rani

  1. On 10/23/2023 at 7:23 PM, Adriano Faria said:

    Create an application or a plugin. Go to dev center, tab Hooks and create a hook then you’ll have a file in applications/appkeyfolder/hooks or plugins/pluginkeyfolder/hooks. Add the script in this file.

    I am able to access the hooks menu now. 

    I am able to add the hook on process form. But here the issue is I have to update the values in the table which is not the part of invision table. 

    For e.g i have table table1. I am using mysqli to update the values on the basis of userid. As this is the common column between ipcore_members and table1.

    I am using one dbconnect.php file to connect to the db using mysqli driver.

    But the $connection object is not available to me in the hook file.

    Can you please help?

  2. On 10/19/2023 at 5:13 PM, Adriano Faria said:

    1: You need to have a local install of the board (with Apache PHP/MySQL, or a Wampserver, etc.).

    2: upload the dev tools:

    3: Enable the developer mode:

    4: create a plugin with 2 code hooks in the classes I pointed above.

     

    Hello adriano,

    I am able to complete step 1,2,3 specified. But as you mentioned I have to write the code in which file among the below plugins\hooks.php file

      '\\IPS\\forums\\Forum' =>
      array (
        2 =>
        array (
          'file' => 'applications/cms/hooks/Forum.php',
          'class' => 'cms_hook_Forum',
        ),
      ),
      '\\IPS\\forums\\modules\\admin\\forums\\forums' =>
      array (
        3 =>
        array (
          'file' => 'applications/cms/hooks/forums.php',
          'class' => 'cms_hook_forums',
        ),
      ),
     
  3. On 10/20/2023 at 7:01 PM, Nathan Explosion said:

    All the files you need are included in the ZIP file for the suite, downloadable from the client area.

    Its available and that error has been removed. Next issue which i m facing is 

    I am able to open only pages like below link.

    http://localhost/marketing_version4.7/index.php?app=cms&module=pages&controller=page

    But when i run urls like below

    http://localhost/marketing_version4.7/discover/

    http://localhost/marketing_version4.7/leaderboard/

    http://localhost/marketing_version4.7/login/

    They are taking me to default page of WAMP server. Rather than going to their specific module.

     

  4. After doing the steps given the articles and suggested by you. When i run the folder at my local, i am getting below error. I checked in the specified location but could not found the file specified. Can someone guide please?

     

    file_get_contents(D:\wamp64\www\marketing_version4.7/applications/forums/data/versions.json): Failed to open stream: No such file or directory

  5. 14 minutes ago, Adriano Faria said:

    - New topic: hook on \IPS\forums\Topic:

    	public static function createFromForm( $values, \IPS\Node\Model $container = NULL, $sendNotification = TRUE )
    	{
    		$item = parent::createFromForm( $values, $container, $sendNotification );
    
    		//do your stuff
    
    		return $item;
    	}

    - New post: hook on \IPS\forums\Topic\Post:

    	public static function create( $item, $comment, $first=FALSE, $guestName=NULL, $incrementPostCount=NULL, $member=NULL, \IPS\DateTime $time=NULL, $ipAddress=NULL, $hiddenStatus=NULL, $anonymous=NULL )
    	{
    		$reply = parent::create( $item, $comment, $first, $guestName, $incrementPostCount, $member, $time, $ipAddress, $hiddenStatus, $anonymous );
    
    		//do your stuff
    
    		return $reply;
    	}

     

    Hey Adriano,

    I have to write the above code in which file? As per the guide i m setting up developer mode at local.

    Do i need  developer mode at local to write above code? Or there is any other way to do this?

  6. On 10/17/2023 at 11:41 AM, DawPi said:

    You have given the general link. Any specific link to convert the hooks in previous i.e. 3.6 version to new 4.7 version will help me a lot.

     

    Right now which I understand is that, I need to enable developer mode, then I can start creating plugins. But i m still not sure about what's next steps? Right now trying to setup developer mode at local.

  7. 18 minutes ago, Nathan Explosion said:

    You still have this in your code - remove it. - Its Removed

     <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

     

    Could contain: Page, Text, Chart, Plot

    You also still have your JS loading set to "Just before the </body> tag" - change it to the setitng I mentioned. - In my invision default theme. Not able to find the settings which you have shared. Can you please share any link for this?

     

    My theme is invision default theme.

  8. 49 minutes ago, Nathan Explosion said:

    OK - I didn't mention anything about putting those items in the footer of the theme so that's your call.

    And you haven't modified the theme setting that I indicated you could change.

    And now you have this as your code

    <!-- <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
        <script src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.js"></script> -->
        <script type="text/javascript">
          jQuery.noConflict();
            jQuery(document).ready(function() {
                jQuery('#example123').DataTable({
                    "bProcessing": true,
                    "bServerSide": true,
                    "sAjaxSource": "https://beta.marketingcheckpoint.com/admin/mailing/ajax_mail_history_dt10.php"
                });
            });
        </script>

    And this as your error:

    Could contain: Text, Page

    Why? You've commented out BOTH the jquery line and the datatables line, and you aren't loading the datatables JS at a later point. Plus you are using "jQuery" instead of "$"

    Use this code in the block, modify the theme setting I indicated, and then advise if it doesn't work:

     

    <script src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.js"></script>
    <script type="text/javascript">
    	$(document).ready(function() {
    		$('#example').DataTable({
              "bProcessing": true,
              "bServerSide": true,
              "sAjaxSource": "https://beta.marketingcheckpoint.com/admin/mailing/ajax_mail_history_dt10.php"
    		});
    	});
    </script>

     

     

    I have tried with $ as well. Also done the RnD with the suggestion you have shared. 

    I have changed like as you have suggested. But still no luck.

  9. 32 minutes ago, Nathan Explosion said:

    OK - first bit of advice...you don't need this as jQuery (v3.7.0) will be provided by Invision's software:

    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

    Secondly...in your screenshot, the error is $(...).DataTable but when I view the site, I see:

    $(...).dataTable is not a function

    The DataTable function is called "DataTable" so if you have do have it as "dataTable" in your code then correct that.

    Finally though, and most important...your code is BEFORE the code that loads up all of Invision's JS. That is possibly why you decided to include that first line of script to load jquery up. You can change that in your theme settings:

    Could contain: Page, Text

     

    Could contain: File, Page, Text, Webpage

    I have updated the code above But its not reflecting.

    For datatable i checked the Datatable Capital (D) issue as well. Still no luck. Any other ways to resolve this ?

  10. 28 minutes ago, Marc Stridgen said:

    You would need to ensure you are using the correct location and that the file is readable there.

    Im not sure what you mean here, as this appears to be essentially the same question

    Issue is this when i m saving in admin section its parsing the content and loading the next line of code. Because the files are on the same location. But when i go to the frontend of the site to view the page

    The url of the browser gets changed and its not able to find the file.

    Could contain: Page, Text, File

     

×
×
  • Create New...