Skip to content

Conversation

@divisio74
Copy link
Contributor

@divisio74 divisio74 commented Oct 1, 2025

GnoADS 📺:

I aimed to recreate an advertising space similar to the Sandbox project, but encountered several challenges when trying to paste and integrate images onto the clickable surface.

For now, the concept focuses on building an advertising grid where individual slots can be bought and sold. Once a plot is purchased, it becomes a link to the buyer’s advertisement, which can be configured using the UpdateCell function.
Each ad is tied to a specific cell, allowing users to own multiple spaces for different promotional content.

Tutorial :

Step 1 :

Buy a cell with the function BuyCell

Step 2 :

Set the ads and the label with the function UpdateCell on yours cells

Step 3 :

Sell your cells with the function SellCell

#Cell Structure

type Cell struct {
	X     int                // position in the grid
	Y     int                // position in the grid
	Color string       // colors of the cells if owned
	Owner address // address of the owner
	Url   string         // url of the ads
	Label string      // pseudo of the owner / name of the ads
}

Preview

image

RoadMap :

-Add determined price (totalcells / availablecells) * baseprice
-Add number of clicks

*The price of a cell is currently free.

@leohhhn
Copy link
Contributor

leohhhn commented Oct 2, 2025

Check the CI!

espace = "                       "
)

// voir diff avec leon/svgbtn.gno
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Write the comment in English, not French


// If the cell is owned by someone else, link to their pub if set
if cell.Owner != "" && cell.Owner != caller {
if cell.Url != "" {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition body can be simplified

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi this is done here : 8958999!

}

// Render the grid
func RenderGrid() string {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is massive, think of adding sub function to make it easier to read.
Also set the cellSize constant in global, it's overall a good practice to centralize all your constant to easily spot them when checking the source, or testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks ,here is the fix : 9eab2e1

@@ -0,0 +1,2 @@
module = "gno.land/r/pierre115/gnopub"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gnoads would make more sense (advertisment)
gnopub more means gno public in english (Not publicité)

Copy link
Contributor Author

@divisio74 divisio74 Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks ! 2acd643


// Function to sell a cell
func SellCells(_ realm, x, y int) string {
if x < 0 || x >= grid.Width || y < 0 || y >= grid.Height {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition is repeated, you can make a sub function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi , this is the fix : 9441d86

Url: "",
Label: "",
}
return ufmt.Sprintf("Cells selled!", x, y)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return ufmt.Sprintf("Cells selled!", x, y)
return ufmt.Sprintf("The cell was successfully sold.", x, y)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take time to think about the return sentences with correct English, because it is an interface to the users.
It should look clean to be used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its corrected !

}

// Function to update the Pub and the Label of yours cells
func UpdateCells(_ realm, x, y int, url, label string) string {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func UpdateCells(_ realm, x, y int, url, label string) string {
func UpdateCell(_ realm, x, y int, url, label string) string {

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall fix all the incorrect English from your code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fixed here : aae2178

Thanks !


}
}
// si on remonte d'une accolade ca marche plus :(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// si on remonte d'une accolade ca marche plus :(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its corrected !

Copy link
Contributor

@leohhhn leohhhn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving some comments to make your code better :)

continue
}
}
link = ufmt.Sprintf("/r/gnopixel$help&func=BuyCell&x=%d&y=%d", x, y)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool library to check out is p/moul/txlink

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has not been resolved yet

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks ! 57f2a12


espace = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"

defaultlink = ufmt.Sprintf("https://gno.land/r/leon/hor:hall")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this link will not work for all networks; this is specific for staging. please change it so that it's network agnostic

)

// Render the grid
func RenderGrid() string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be exported?


// Function to sell a cell
func SellCell(_ realm, x, y int) string {
if err := GetValidate(x, y); err != "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetValidate is a weird name, and it's exported for some reason?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, its fixed here : 0003d77 !

@@ -0,0 +1,2 @@
module = "gno.land/r/pierre115/gnoads"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gnoads != gnopub. Make it all match

Copy link
Contributor

@leohhhn leohhhn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still a few unresolved comments, take a look at them and fix them up please :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants