Jump to content
  • 0

Extragere Variabila


COOLPIX

Question

Salut!

Cine ma poate ajuta, sa extrag variabila din widget.

Se va intelege mai bine din poza:

Eu doresc sa extrag doar partea cu citi membri sunt online pe forum, sa sa o pot integra pe orice parte a forumului, mai exact in globalTemplate.

Multumes!

2023-05-08_20-57-12.png

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Variabila in sine nu ai cum sa o extragi, ce poti face in schimb e sa utilizezi javascript sa ti-o citeasca de acolo si sa ti-o puna unde vrei tu in globalTemplate, cauta pe net ca gasesti repede, eu nu le mai am deloc cu js si nu vreau sa-ti scriu vreo prostie de cod.

Link to comment
Share on other sites

  • 0
On 5/9/2023 at 12:32 PM, Juliano Dillon said:

Variabila in sine nu ai cum sa o extragi, ce poti face in schimb e sa utilizezi javascript sa ti-o citeasca de acolo si sa ti-o puna unde vrei tu in globalTemplate, cauta pe net ca gasesti repede, eu nu le mai am deloc cu js si nu vreau sa-ti scriu vreo prostie de cod.

Am asa ceva, dar nu reusesc.

/* Init */
		$members     = array();
		$anonymous   = 0;
		
		$users = \IPS\Session\Store::i()->getOnlineUsers( \IPS\Session\Store::ONLINE_MEMBERS, 'desc', NULL, NULL, TRUE );
		foreach( $users as $row )
		{
			switch ( $row['login_type'] )
			{
				/* Not-anonymous Member */
				case \IPS\Session\Front::LOGIN_TYPE_MEMBER:
					if ( $row['member_name'] )
					{
						$members[ $row['member_id'] ] = $row;
					}
					break;
					
				/* Anonymous member */
				case \IPS\Session\Front::LOGIN_TYPE_ANONYMOUS:
					$anonymous += 1;
					break;
			}
		}
		$memberCount = \count( $members );
		echo $memberCount;

 

Link to comment
Share on other sites

  • 0

Pai asta iti spun, nu ai cum sa extragi variabila din template-ul aplicatiei pentru ca nu ti-o va recunoaste, aplicatia se foloseste de numarul total al membrilor si verifica cati au statusul de "Online" activ, singura varianta e sa utilizezi javascript pentru a lua valoarea din acel "span", "div", "li" etc. al widget-ului.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.